Documentation
¶
Index ¶
- func LogError(message string, err error)
- func LogInfo(message string)
- func LogRequests(r *http.Request)
- func LogResult(response voucher.Response)
- func LogWarning(message string, err error)
- func NewRouter(s *Server) *mux.Router
- type Config
- type Route
- type Server
- func (server *Server) GetCheckGroup(name string) []string
- func (s *Server) HandleCheckImage(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleHealthCheck(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleVerifyImage(w http.ResponseWriter, r *http.Request)
- func (server *Server) HasCheckGroup(name string) bool
- func (server *Server) Serve()
- func (server *Server) SetCheckGroup(name string, checkNames []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogInfo ¶
func LogInfo(message string)
LogInfo logs server information to stdout as Information.
func LogRequests ¶
LogRequests logs the request fields to stdout as Info
func LogWarning ¶
LogWarning logs server errors to stdout as Warning
Types ¶
type Config ¶
Config is a structure which contains Server configuration.
func (*Config) TimeoutDuration ¶
TimeoutDuration returns the configured timeout for this Server.
type Route ¶
type Route struct { Name string Method string Path string HandlerFunc http.HandlerFunc }
Route stores metadata about a particular endpoint
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetCheckGroup ¶
GetCheckGroup returns a list of checks names that are in the check group with the passed name.
func (*Server) HandleCheckImage ¶
func (s *Server) HandleCheckImage(w http.ResponseWriter, r *http.Request)
HandleCheckImage is a request handler that executes an individual Check or all of the Checks in one CheckGroup and creates any attestations if applicable.
func (*Server) HandleHealthCheck ¶
func (s *Server) HandleHealthCheck(w http.ResponseWriter, r *http.Request)
HandleHealthCheck is a request handler that returns HTTP Status Code 200 when it is called. Can be used to determine uptime.
func (*Server) HandleVerifyImage ¶
func (s *Server) HandleVerifyImage(w http.ResponseWriter, r *http.Request)
HandleVerifyImage is a request handler that verifies an individual attestation or all of the attestations which would be created by one CheckGroup and creates any attestations if applicable.
func (*Server) HasCheckGroup ¶
HasCheckGroup returns true if the Check Group with the passed name has been registered with the server.
func (*Server) SetCheckGroup ¶
SetCheckGroup adds a list of checks as a group with the passed name.