Documentation
¶
Overview ¶
Package http implements the HTTP server handlers for different resource endpoints
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxQueryWindow = errors.New("maximum query window exceeded") ErrMalformedTimeStamp = errors.New("malformed timestamp") )
Functions ¶
Types ¶
type CEEMSServer ¶
type CEEMSServer struct {
// contains filtered or unexported fields
}
CEEMSServer struct implements HTTP server for stats.
func New ¶ added in v0.2.0
func New(c *Config) (*CEEMSServer, func(), error)
New creates new CEEMSServer struct instance.
func (*CEEMSServer) Shutdown ¶
func (s *CEEMSServer) Shutdown(ctx context.Context) error
Shutdown server.
func (*CEEMSServer) Start ¶
func (s *CEEMSServer) Start() error
Start launches CEEMS HTTP server godoc
@title CEEMS API @version 1.0 @description OpenAPI specification (OAS) for the CEEMS REST API. @description @description See the Interactive Docs to try CEEMS API methods without writing code, and get @description the complete schema of resources exposed by the API. @description @description If basic auth is enabled, all the endpoints require authentication. @description @description All the endpoints, except `health`, `swagger`, `debug` and `demo`, @description must send a user-agent header. @description @description Timestamps must be specified in milliseconds, unless otherwise specified. @contact.name Mahendra Paipuri @contact.url https://github.com/mahendrapaipuri/ceems/issues @contact.email mahendra.paipuri@gmail.com @license.name GPL-3.0 license @license.url https://www.gnu.org/licenses/gpl-3.0.en.html @securityDefinitions.basic BasicAuth @externalDocs.url https://mahendrapaipuri.github.io/ceems/
type Response ¶
type Response[T any] struct { Status string `json:"status"` Data []T `json:"data"` ErrorType errorType `json:"errorType,omitempty"` Error string `json:"error,omitempty"` Warnings []string `json:"warnings,omitempty"` }
Response defines the response model of CEEMSAPIServer.
type WebConfig ¶
type WebConfig struct { Addresses []string WebSystemdSocket bool WebConfigFile string RoutePrefix string `yaml:"route_prefix"` MaxQueryPeriod model.Duration `yaml:"max_query"` RequestsLimit int `yaml:"requests_limit"` URL string `yaml:"url"` HTTPClientConfig config.HTTPClientConfig `yaml:",inline"` }
WebConfig makes HTTP web config from CLI args.
func (*WebConfig) UnmarshalYAML ¶ added in v0.5.2
UnmarshalYAML implements the yaml.Unmarshaler interface.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.