aboutsummaryrefslogtreecommitdiff
path: root/endpoint.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-06-01 21:37:54 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-06-01 21:37:54 +0200
commit2dcaf038655426c572c5d292973001c581f0a1a2 (patch)
treef52f2c93404a3f13e590c4af87ff349d563eae14 /endpoint.go
parent2c2c6936a93ce4f18302426a665ed5782910ab85 (diff)
moved endpoint type into types
Diffstat (limited to 'endpoint.go')
-rw-r--r--endpoint.go21
1 files changed, 0 insertions, 21 deletions
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)