This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package greetertransport | |
import ( | |
pb "github.com/antklim/go-microservices/gizmo-greeter/pb" | |
ocontext "golang.org/x/net/context" | |
) | |
// Greeting implementation of the gRPC service. | |
func (s *TService) Greeting(ctx ocontext.Context, r *pb.GreetingRequest) (*pb.GreetingResponse, error) { | |
return &pb.GreetingResponse{Greeting: "Hola Gizmo RPC " + r.Name}, nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: | |
name: myService | |
... | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
deploymentBucket: | |
name: my.service.deployment.bucket | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('request-promise-native') | |
const request = require('request-promise-native') | |
describe('Provider unit test', () => { | |
let provider | |
beforeAll(() => { | |
process.env.DOWNSTREAM_API_URL = 'http://test.com' | |
provider = require('./provider') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('@src/provider') | |
const provider = require('@src/provider') | |
const request = require('supertest') | |
const App = require('@src/app') | |
const router = require('@src/router') | |
const app = new App({ router }).init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"_postman_id": "12345", | |
"name": "WHATS-THE-TAB", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "songs", | |
"item": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert') | |
/** | |
* Arrays have same length | |
* Array length within the range [0..200000] | |
* Number of frontend developers within the range [0..200000] | |
* | |
* @param Array - array of frontend contributions | |
* @param Array - array of backend contributions | |
* @param Number - number of frontend developers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CalculusScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Container( | |
child: SafeArea( | |
child: ListView( | |
padding: const EdgeInsets.symmetric(horizontal: 24.0), | |
children: <Widget>[ | |
Header(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Operation { addition, subtraction, division, multiplication, sqrt } | |
class CalculatorInput extends StatefulWidget { | |
@override | |
_CalculatorInputState createState() => _CalculatorInputState(); | |
} | |
class _CalculatorInputState extends State<CalculatorInput> { | |
final operations = <Operation, String>{ | |
Operation.addition: 'Addition', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Operand extends StatefulWidget { | |
final String label; | |
final num initValue; | |
const Operand({Key key, this.label, this.initValue}) : super(key: key); | |
@override | |
_OperandState createState() => _OperandState(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Operand { A, B } // Added to identify operands | |
class CalculatorInput extends StatefulWidget { | |
final num memory; // Memory state passed by parent widget | |
final ValueChanged<num> onChanged; // Calculator state listener | |
const CalculatorInput({Key key, this.memory, this.onChanged}) | |
: super(key: key); | |
@override |