Documentation
¶
Index ¶
- Constants
- type Cmd
- type ErrorResponse
- type HTTPHandler
- type Handler
- type Operation
- func (c *Operation) AddVC(w http.ResponseWriter, r *http.Request)
- func (c *Operation) GetEntries(w http.ResponseWriter, r *http.Request)
- func (c *Operation) GetEntryAndProof(w http.ResponseWriter, r *http.Request)
- func (c *Operation) GetIssuers(w http.ResponseWriter, _ *http.Request)
- func (c *Operation) GetProofByHash(w http.ResponseWriter, r *http.Request)
- func (c *Operation) GetPublicKey(w http.ResponseWriter, _ *http.Request)
- func (c *Operation) GetRESTHandlers() []Handler
- func (c *Operation) GetSTH(w http.ResponseWriter, _ *http.Request)
- func (c *Operation) GetSTHConsistency(w http.ResponseWriter, r *http.Request)
- func (c *Operation) HealthCheck(w http.ResponseWriter, _ *http.Request)
Constants ¶
const ( AddVCPath = basePath + "/add-vc" GetSTHPath = basePath + "/get-sth" GetSTHConsistencyPath = basePath + "/get-sth-consistency" GetProofByHashPath = basePath + "/get-proof-by-hash" GetEntriesPath = basePath + "/get-entries" GetIssuersPath = basePath + "/get-issuers" GetEntryAndProofPath = basePath + "/get-entry-and-proof" GetPublicKeyPath = basePath + "/get-public-key" HealthCheckPath = "/healthcheck" )
API endpoints.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd interface {
AddVC(io.Writer, io.Reader) error
GetIssuers(io.Writer, io.Reader) error
GetSTH(io.Writer, io.Reader) error
GetSTHConsistency(io.Writer, io.Reader) error
GetProofByHash(io.Writer, io.Reader) error
GetEntries(io.Writer, io.Reader) error
GetEntryAndProof(io.Writer, io.Reader) error
GetPublicKey(io.Writer, io.Reader) error
}
Cmd defines command methods.
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse represents REST error message.
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
HTTPHandler contains REST API handling details which can be used to build routers for http requests for given path.
func NewHTTPHandler ¶
func NewHTTPHandler(path, method string, handle http.HandlerFunc) *HTTPHandler
NewHTTPHandler returns instance of HTTPHandler which can be used handle http requests.
func (*HTTPHandler) Handle ¶
func (h *HTTPHandler) Handle() http.HandlerFunc
Handle returns http request handle func.
func (*HTTPHandler) Method ¶
func (h *HTTPHandler) Method() string
Method returns http request method type.
type Handler ¶
type Handler interface {
Path() string
Method() string
Handle() http.HandlerFunc
}
Handler http handler for each controller API endpoint.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation represents REST API controller.
func (*Operation) AddVC ¶
func (c *Operation) AddVC(w http.ResponseWriter, r *http.Request)
AddVC adds verifiable credential to log.
func (*Operation) GetEntries ¶
func (c *Operation) GetEntries(w http.ResponseWriter, r *http.Request)
GetEntries retrieves entries from log.
func (*Operation) GetEntryAndProof ¶
func (c *Operation) GetEntryAndProof(w http.ResponseWriter, r *http.Request)
GetEntryAndProof retrieves entry and merkle audit proof from log.
func (*Operation) GetIssuers ¶
func (c *Operation) GetIssuers(w http.ResponseWriter, _ *http.Request)
GetIssuers returns issuers.
func (*Operation) GetProofByHash ¶
func (c *Operation) GetProofByHash(w http.ResponseWriter, r *http.Request)
GetProofByHash retrieves Merkle Audit proof from Log by leaf hash.
func (*Operation) GetPublicKey ¶
func (c *Operation) GetPublicKey(w http.ResponseWriter, _ *http.Request)
GetPublicKey returns public key.
func (*Operation) GetRESTHandlers ¶
GetRESTHandlers returns list of all handlers supported by this controller.
func (*Operation) GetSTH ¶
func (c *Operation) GetSTH(w http.ResponseWriter, _ *http.Request)
GetSTH retrieves latest signed tree head.
func (*Operation) GetSTHConsistency ¶
func (c *Operation) GetSTHConsistency(w http.ResponseWriter, r *http.Request)
GetSTHConsistency retrieves merkle consistency proofs between signed tree heads.
func (*Operation) HealthCheck ¶
func (c *Operation) HealthCheck(w http.ResponseWriter, _ *http.Request)
HealthCheck returns status.