Documentation
¶
Index ¶
- func Build(mux *http.ServeMux, config *Config, datastores map[string]*datastore.Service, ...) error
- func IsHelpOption(args []string) bool
- func NewConfigHandler(config *Config) http.Handler
- func NewProfHandler() *memProfHandler
- func RunApp(version string, args []string, wg *sync.WaitGroup)deprecated
- func RunAppError(version string, args []string, wg *sync.WaitGroup) error
- func RunAppWithConfig(version string, args []string, cp configProvider)deprecated
- func RunAppWithConfigError(version string, args []string, cp configProvider) error
- func RunAppWithConfigWaitError(version string, args []string, cp configProvider, wg *sync.WaitGroup) error
- type AuthHandler
- type AuthMux
- type Config
- type Hook
- type Options
- type Service
- func (s *Service) Listen() (net.Listener, error)
- func (s *Service) ListenAndServe() errordeprecated
- func (s *Service) ListenAndServeTLS(certFile, keyFile string) errordeprecated
- func (s *Service) SelfTest() error
- func (s *Service) Serve(l net.Listener) error
- func (s *Service) Shutdown(ctx context.Context) error
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigHandler ¶
func NewProfHandler ¶ added in v0.4.0
func NewProfHandler() *memProfHandler
func RunAppError ¶ added in v0.4.0
func RunAppWithConfig
deprecated
func RunAppWithConfigError ¶ added in v0.4.0
func RunAppWithConfigWaitError ¶ added in v0.8.0
func RunAppWithConfigWaitError(version string, args []string, cp configProvider, wg *sync.WaitGroup) error
RunAppWithConfigWaitError is the full options versions. version is printed if provided in the options. TODO auto-determine version. cp is a function that can provide a configuration file. wg.Done() will be called once, when the server is finished booting up.
Types ¶
type AuthHandler ¶ added in v0.7.0
type AuthHandler struct { *Config // contains filtered or unexported fields }
func NewAuthHandler ¶ added in v0.7.0
func NewAuthHandler(config *Config, handler http.Handler) *AuthHandler
func (*AuthHandler) ServeHTTP ¶ added in v0.7.0
func (h *AuthHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)
type AuthMux ¶ added in v0.7.0
type AuthMux struct {
// contains filtered or unexported fields
}
func (*AuthMux) HandleFunc ¶ added in v0.7.0
type Config ¶
type Config struct { config.ModelList `json:",omitempty" yaml:",inline"` sconfig.DatastoreList `json:",omitempty" yaml:",inline"` // GlobalBatching provides a default batching configuration if // models do not provide their own. // If GlobalBatching is provided but a model should not be batching, // set BatchWait to < 0. GlobalBatching *batchconfig.BatcherConfig `json:",omitempty" yaml:",omitempty"` Metrics *econfig.MetricsConfig `json:",omitempty" yaml:",omitempty"` Endpoint econfig.Endpoint EnableMemProf bool EnableCPUProf bool TLS *TLSConfig AllowedSubnet []string `json:",omitempty" yaml:",omitempty"` }
Config represents an endpoint config
func NewConfigFromURL ¶
NewConfigFromURL creates a new config from URL
func (*Config) LoadFromURL ¶
type Options ¶
type Options struct { ConfigURL string `short:"c" long:"cfg" description:"config URI"` Version bool `short:"v" long:"version" description:"indexer version"` }
Options represents an option
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the primary container for all HTTP based services.
func (*Service) ListenAndServe
deprecated
func (*Service) ListenAndServeTLS
deprecated
Source Files
¶
Click to show internal directories.
Click to hide internal directories.