Skip to content

Instantly share code, notes, and snippets.

View indrasaputra's full-sized avatar
🎯
Focusing

Indra Saputra indrasaputra

🎯
Focusing
View GitHub Profile
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <utility>
#include <bitset>
#define fi first
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <utility>
#include <bitset>
#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <utility>
#include <cctype>
// Blog is the main business process(es).
type Blog interface {
// CreateArticle creates an article then publish it.
CreateArticle(article Article) error
// GetArticles retrieves an article based on its id.
GetArticle(id int) (Article, error)
}
package blog
import "time"
// Article is our beloved article struct.
// This struct can be moved to another package,
// such as `package entity`.
// But, I choose to put it here because
// of readability reason.
type Article struct {
type Kubernetes struct {
// omitted
}
type Service struct {
Name string
HasMetric bool
HasLog bool
HasDocument bool
HasCICD bool
func main() {
ctx := context.Background()
kube := &Kubernetes{}
checker := &Checker{}
services, _ := kube.AllServices(ctx)
// let's make a new services container
// so we don't bother with pointer
func (c *Checker) CheckStandardsGoroutineChannel(ctx context.Context, svc *Service, svcChan chan *Service, errChan chan []error) {
// this function still does what CheckStandards does,
// but instead of returning the values,
// it sends the values to channel
svcChan <- svc
errChan <- errorList
}
func main() {
ctx := context.Background()