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
FROM golang:1.16-alpine | |
WORKDIR /app | |
RUN apk add --no-cache ca-certificates git openssl | |
RUN go env -w GOPRIVATE=github.com/org-name/levven-go | |
RUN go env -w GO111MODULE="" | |
ARG GITHUB_TOKEN |
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
FROM golang:1.16-alpine | |
WORKDIR /app | |
RUN apk add --no-cache ca-certificates git openssl | |
RUN go env -w GOPRIVATE=github.com/org-name/levven-go | |
RUN go env -w GO111MODULE="" | |
ARG GITHUB_TOKEN |
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
--- | |
- name: "Create or ensure log dir" | |
file: | |
path: "/var/log" | |
state: directory | |
recurse: yes | |
mode: "0755" | |
owner: "my_service_user" | |
group: "my_service" |
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
package main | |
import ( | |
"errors" | |
"net/http" | |
"time" | |
) | |
// makeRequest makes simple http request and returns an error channel | |
func makeRequest() <-chan error { |
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
package client | |
import ( | |
"net/http" | |
) | |
// makeRequest makes simple http request and returns a response string | |
func makeRequest() error { | |
resp, err := http.Get("https://medium.com") | |
if err != nil { |
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
package sendgrid | |
// Remove the interface and change the concrete type to public | |
type SendGrid struct { | |
/* impl */ | |
} | |
// Change the NewSendGrid to return pointer to SendGrid instead. | |
func NewSendGrid(host string) *SendGrid { |
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
package sendgrid | |
type SendGrid interface { | |
SendValidationEmail(email string) error | |
SendPasswordChangeEmail(email string) error | |
} | |
// sendgrid is our Sendgrid implementation. | |
type sendgrid struct { | |
/* impl */ |
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
type Vehicle interface { | |
Drive() | |
} | |
// Car implements the Vehicle interface simply by implementing method Drive. | |
type Car struct{} | |
func (c Car) Drive() { | |
fmt.Println("Drive") | |
} |
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
interface Vehicle | |
{ | |
// public and abstract | |
void drive(); | |
} | |
// A class that implements the interface. | |
class Car implements Vehicle | |
{ | |
// Implementing the capabilities of |
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
server { | |
listen 80; | |
server_name _; | |
# Redirect all traffic to SSL | |
return 301 https://$host$request_uri; | |
} | |
server { |
NewerOlder