- Ketika kita me-running sebuah Kubernetes, artinya kita me-running sebuah Cluster (Kubernetes Cluster).
- Cluster terdiri dari dua bagian besar, yakni Kubernetes Master dan Kubernetes Worker/Node
This file contains 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
//Regular Expressions List | |
//Short Tutorial | |
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc. | |
. // match any character except newline | |
x // match any instance of x | |
[^x] // match any character except x | |
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z | |
| // an OR operator - [x|y] will match an instance of x or y |
This file contains 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
syntax = "proto3"; | |
package grpc; | |
option go_package = "./grpc"; | |
service RecipeService { | |
rpc FetchRecipe(RecipeFilter) returns (RecipeResult) {} | |
} | |
service RecipeCategoryService { |
This file contains 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
[ | |
{ | |
"id": "c-17", | |
"title": "Campaign and Activity", | |
"items": [ | |
{ | |
"id": "47", | |
"type": "link", | |
"saved": false, | |
"text": "Chef Siscaa", |
This file contains 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 expect = require("chai").expect; | |
const { spy, stub } = require("sinon"); | |
const companyService = require("../src/services/company.service"); | |
const companyHandler = require("../src/handlers/company.handler"); | |
const companyProfileMock = { | |
companyName: 'Facebook Inc', | |
companyUsers: [ | |
{ id: 1, name: 'mojombo' }, |
This file contains 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 expect = require("chai").expect; | |
const { stub } = require("sinon"); | |
const companyRepository = require("../src/repositories/company.repository"); | |
const companyService = require("../src/services/company.service"); | |
const usersMock = require("./mocks/users"); | |
const employeesMock = require("./mocks/employees"); | |
describe("test company service", function () { | |
afterEach(() => { |
This file contains 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 expect = require("chai").expect; | |
const nock = require("nock"); | |
const companyRepository = require("../src/repositories/company.repository"); | |
const usersMock = require("./mocks/users"); | |
describe("test company repository", function () { | |
after(function() { | |
nock.restore(); | |
}); |
This file contains 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 companyService = require("../services/company.service"); | |
async function fetchCompanyProfile(req, res) { | |
try { | |
const companyProfile = await companyService.fetchCompanyProfile(); | |
res.json(companyProfile); | |
} catch (e) { | |
errorResponse(e, res); | |
} |
This file contains 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 companyRepository = require("../repositories/company.repository"); | |
async function fetchCompanyProfile() { | |
const users = await companyRepository.fetchUsers(); | |
const employees = await companyRepository.fetchEmployees(); | |
const companyUsers = []; | |
for (let user of users) { | |
companyUsers.push({ | |
id: user.id, |
This file contains 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 axios = require("axios"); | |
async function fetchUsers() { | |
const { data } = await axios.get("https://api.github.com/users"); | |
return data; | |
} | |
async function fetchEmployees() { | |
const { data: { data } } = |
NewerOlder