diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-06-01 21:37:54 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-06-01 21:37:54 +0200 |
commit | 2dcaf038655426c572c5d292973001c581f0a1a2 (patch) | |
tree | f52f2c93404a3f13e590c4af87ff349d563eae14 /instance.go | |
parent | 2c2c6936a93ce4f18302426a665ed5782910ab85 (diff) |
moved endpoint type into types
Diffstat (limited to 'instance.go')
-rw-r--r-- | instance.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/instance.go b/instance.go index 5d358c1..4425770 100644 --- a/instance.go +++ b/instance.go @@ -22,14 +22,14 @@ type Instance struct { // Handlers returns a list of STFE handlers func (i *Instance) Handlers() []Handler { return []Handler{ - Handler{Instance: i, Handler: addEntry, Endpoint: EndpointAddEntry, Method: http.MethodPost}, - Handler{Instance: i, Handler: addCosignature, Endpoint: EndpointAddCosignature, Method: http.MethodPost}, - Handler{Instance: i, Handler: getLatestSth, Endpoint: EndpointGetLatestSth, Method: http.MethodGet}, - Handler{Instance: i, Handler: getStableSth, Endpoint: EndpointGetStableSth, Method: http.MethodGet}, - Handler{Instance: i, Handler: getCosignedSth, Endpoint: EndpointGetCosignedSth, Method: http.MethodGet}, - Handler{Instance: i, Handler: getProofByHash, Endpoint: EndpointGetProofByHash, Method: http.MethodPost}, - Handler{Instance: i, Handler: getConsistencyProof, Endpoint: EndpointGetConsistencyProof, Method: http.MethodPost}, - Handler{Instance: i, Handler: getEntries, Endpoint: EndpointGetEntries, Method: http.MethodPost}, + Handler{Instance: i, Handler: addEntry, Endpoint: types.EndpointAddLeaf, Method: http.MethodPost}, + Handler{Instance: i, Handler: addCosignature, Endpoint: types.EndpointAddCosignature, Method: http.MethodPost}, + Handler{Instance: i, Handler: getLatestSth, Endpoint: types.EndpointGetTreeHeadLatest, Method: http.MethodGet}, + Handler{Instance: i, Handler: getStableSth, Endpoint: types.EndpointGetTreeHeadToSign, Method: http.MethodGet}, + Handler{Instance: i, Handler: getCosignedSth, Endpoint: types.EndpointGetTreeHeadCosigned, Method: http.MethodGet}, + Handler{Instance: i, Handler: getProofByHash, Endpoint: types.EndpointGetProofByHash, Method: http.MethodPost}, + Handler{Instance: i, Handler: getConsistencyProof, Endpoint: types.EndpointGetConsistencyProof, Method: http.MethodPost}, + Handler{Instance: i, Handler: getEntries, Endpoint: types.EndpointGetLeaves, Method: http.MethodPost}, } } @@ -37,7 +37,7 @@ func (i *Instance) Handlers() []Handler { // to an STFE server instance as well as a function that uses it. type Handler struct { Instance *Instance - Endpoint Endpoint + Endpoint types.Endpoint Method string Handler func(context.Context, *Instance, http.ResponseWriter, *http.Request) (int, error) } |