Documentation
¶
Index ¶
Constants ¶
View Source
const (
// ErrInvalidMethod is used if the HTTP method is not supported
ErrInvalidMethod = "Invalid method"
)
Variables ¶
View Source
var ( // JSONHandle is the codec that handles to JSON encode structs. JSONHandle = &codec.JsonHandle{ HTMLCharsAsIs: true, } )
Functions ¶
Types ¶
type Command ¶
Command is the agent command structure used to track passed args as well as the CLI meta.
type HTTPCodedError ¶
HTTPCodedError is used to provide the HTTP error code.
func CodedError ¶
func CodedError(c int, s string) HTTPCodedError
CodedError returns an interface to the Replicator HTTP error code.
type HTTPServer ¶
type HTTPServer struct {
Addr string
// contains filtered or unexported fields
}
HTTPServer is used to wrap an Agent and expose it over an HTTP interface
func NewHTTPServer ¶
func NewHTTPServer(agent *Command, config *structs.Config) (*HTTPServer, error)
NewHTTPServer starts the HTTP API server for the Replicator agent.
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown()
Shutdown is used to shutdown the HTTP server.
func (*HTTPServer) StatusLeaderRequest ¶
func (s *HTTPServer) StatusLeaderRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error)
StatusLeaderRequest is used to perform the Status.Leader API request.
Click to show internal directories.
Click to hide internal directories.