-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from graillus/features/trigger-refresh-by-api
feat: trigger refresh through API endpoint
- Loading branch information
Showing
6 changed files
with
439 additions
and
59 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import "net/http" | ||
|
||
func (app *App) ApiHandler(resp http.ResponseWriter, r *http.Request) { | ||
if r.Method != http.MethodPost { | ||
resp.Header().Add("Allow", "POST") | ||
resp.WriteHeader(http.StatusMethodNotAllowed) | ||
return | ||
} | ||
|
||
hashes := app.translations.Fetch() | ||
app.refresher.Refresh(hashes) | ||
resp.WriteHeader(http.StatusAccepted) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,52 @@ | ||
module translations-refresher | ||
|
||
go 1.15 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/google/go-cmp v0.5.2 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/opentracing/opentracing-go v1.2.0 // indirect | ||
github.com/prometheus/client_golang v1.8.0 | ||
github.com/prometheus/client_golang v1.11.1 | ||
github.com/robfig/cron/v3 v3.0.1 | ||
github.com/slok/kubewebhook v0.3.0 | ||
github.com/stretchr/testify v1.6.1 // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
k8s.io/api v0.19.3 | ||
k8s.io/apimachinery v0.19.3 | ||
k8s.io/client-go v0.19.0 | ||
github.com/slok/kubewebhook v0.11.0 | ||
k8s.io/api v0.22.9 | ||
k8s.io/apimachinery v0.22.9 | ||
k8s.io/client-go v0.22.9 | ||
) | ||
|
||
require ( | ||
cloud.google.com/go v0.54.0 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/cespare/xxhash/v2 v2.1.1 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/go-logr/logr v0.4.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/go-cmp v0.5.5 // indirect | ||
github.com/google/gofuzz v1.1.0 // indirect | ||
github.com/googleapis/gnostic v0.5.5 // indirect | ||
github.com/imdario/mergo v0.3.5 // indirect | ||
github.com/json-iterator/go v1.1.11 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/opentracing/opentracing-go v1.2.0 // indirect | ||
github.com/prometheus/client_model v0.2.0 // indirect | ||
github.com/prometheus/common v0.26.0 // indirect | ||
github.com/prometheus/procfs v0.6.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect | ||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect | ||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect | ||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect | ||
golang.org/x/text v0.3.6 // indirect | ||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect | ||
gomodules.xyz/jsonpatch/v3 v3.0.1 // indirect | ||
gomodules.xyz/orderedmap v0.1.0 // indirect | ||
google.golang.org/appengine v1.6.5 // indirect | ||
google.golang.org/protobuf v1.26.0 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
k8s.io/klog/v2 v2.9.0 // indirect | ||
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect | ||
sigs.k8s.io/yaml v1.2.0 // indirect | ||
) |
Oops, something went wrong.