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 FacesListOptions struct { | |
Limit int `json:"limit"` | |
Page int `json:"page"` | |
} |
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 facest | |
import "time" | |
type FacesList struct { | |
Count int `json:"count"` | |
PagesCount int `json:"pages_count"` | |
Faces []Face `json:"faces"` | |
} |
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 errorResponse struct { | |
Code int `json:"code"` | |
Message string `json:"message"` | |
} | |
type successResponse struct { | |
Code int `json:"code"` | |
Data interface{} `json:"data"` | |
} |
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 facest | |
import ( | |
"net/http" | |
"time" | |
) | |
const ( | |
BaseURLV1 = "https://api.facest.io/v1" | |
) |
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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: sa-secret | |
data: | |
sa_json: YOUR_SERVICE_ACCOUNT_BASE64_KEY | |
--- | |
apiVersion: apps/v1 |
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
#... | |
securityContext: | |
privileged: true | |
capabilities: | |
add: | |
- SYS_ADMIN | |
lifecycle: | |
postStart: | |
exec: |
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.10.0-alpine AS gcsfuse | |
RUN apk add --no-cache git | |
ENV GOPATH /go | |
RUN go get -u github.com/googlecloudplatform/gcsfuse | |
FROM nginx:alpine | |
RUN apk add --no-cache ca-certificates fuse |
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
GET http://localhost:8888/ |
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 ( | |
"log" | |
"net/http" | |
) | |
var limiter = NewIPRateLimiter(1, 5) | |
func main() { |
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 ( | |
"sync" | |
"golang.org/x/time/rate" | |
) | |
// IPRateLimiter . | |
type IPRateLimiter struct { |