From 2dcaf038655426c572c5d292973001c581f0a1a2 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 1 Jun 2021 21:37:54 +0200 Subject: moved endpoint type into types --- endpoint.go | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'endpoint.go') diff --git a/endpoint.go b/endpoint.go index 19ea388..9be55b4 100644 --- a/endpoint.go +++ b/endpoint.go @@ -5,33 +5,12 @@ import ( "crypto/ed25519" "fmt" "net/http" - "strings" "github.com/golang/glog" "github.com/google/trillian" "github.com/system-transparency/stfe/types" ) -// Endpoint is a named HTTP API endpoint -type Endpoint string - -const ( - EndpointAddEntry = Endpoint("add-leaf") - EndpointAddCosignature = Endpoint("add-cosignature") - EndpointGetLatestSth = Endpoint("get-tree-head-latest") - EndpointGetStableSth = Endpoint("get-tree-head-to-sign") - EndpointGetCosignedSth = Endpoint("get-tree-head-cosigned") - EndpointGetProofByHash = Endpoint("get-proof-by-hash") - EndpointGetConsistencyProof = Endpoint("get-consistency-proof") - EndpointGetEntries = Endpoint("get-leaves") -) - -// Path joins a number of components to form a full endpoint path, e.g., base -// ("example.com"), prefix ("st/v1"), and the endpoint itself ("get-sth"). -func (e Endpoint) Path(components ...string) string { - return strings.Join(append(components, string(e)), "/") -} - func addEntry(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) { glog.V(3).Info("handling add-entry request") leaf, err := i.LogParameters.parseAddEntryV1Request(r) -- cgit v1.2.3