Documentation
¶
Overview ¶
Package server contains implementation of REST API server (HTTPServer) for the Insights content service. In current version, the following REST API endpoints are available:
Index ¶
Constants ¶
View Source
const ( // MainEndpoint defines suffix of the root endpoint MainEndpoint = "" // GroupsEndpoint defines suffix of the groups request endpoint GroupsEndpoint = "groups" // AllContentEndpoint defines suffix for all the content AllContentEndpoint = "content" // MetricsEndpoint returns Prometheus metrics MetricsEndpoint = "metrics" // StatusEndpoint returns status of all rules that have been read and // parsed StatusEndpoint = "status" // InfoEndpoint returns basic information about content service // version, utils repository version, commit hash etc. InfoEndpoint = "info" )
Paths for all REST API endpoints served by this service
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationError ¶
type AuthenticationError struct {
// contains filtered or unexported fields
}
AuthenticationError happens during auth problems, for example malformed token
type Configuration ¶
type Configuration struct {
Address string `mapstructure:"address" toml:"address"`
APIPrefix string `mapstructure:"api_prefix" toml:"api_prefix"`
APISpecFile string `mapstructure:"api_spec_file" toml:"api_spec_file"`
Debug bool `mapstructure:"debug" toml:"debug"`
}
Configuration represents configuration of REST API HTTP server
type HTTPServer ¶
type HTTPServer struct {
Config Configuration
InfoParams map[string]string
Groups map[string]groups.Group
Content content.RuleContentDirectory
Serv *http.Server
// contains filtered or unexported fields
}
HTTPServer in an implementation of Server interface
func New ¶
func New(config Configuration, groupsMap map[string]groups.Group, contentDir content.RuleContentDirectory, ruleContentStatusMap map[string]types.RuleContentStatus) *HTTPServer
New constructs new implementation of Server interface
func (*HTTPServer) Initialize ¶
func (server *HTTPServer) Initialize() http.Handler
Initialize method performs the server initialization
Click to show internal directories.
Click to hide internal directories.