Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API is the main struct for the API. can be used for both Admin and Query APIs
func (*API) AddAdminPaths ¶
func (api *API) AddAdminPaths()
AddAdminPaths adds the admin URLs to the Echo instance
func (*API) AddQueryPaths ¶
func (api *API) AddQueryPaths()
AddQueryPaths adds the two query URLs to the Echo instance
func (*API) ListenAndServe ¶
func (api *API) ListenAndServe()
ListenAndServe starts the API server based on the config
type Config ¶
type Config struct {
// BasePath is the basepath for the API
BasePath string
// BasePathAdmin is the basepath for the Admin API
BasePathAdmin string
// ListenAddr is the address to listen on
ListenAddr string
// IsTLS is a flag to enable TLS
IsTLS bool
// TLSCert is the path to the TLS certificate
TLSCert string
// TLSKey is the path to the TLS key
TLSKey string
// AuthMethodAPI is the authentication method to use. Can be "none" or "basic"
AuthMethodAPI string
// AuthUsersAPI is a map of username:password for basic auth
AuthUsersAPI map[string]string
// AuthMethodAdmin is the authentication method to use. Can be "none" or "basic"
AuthMethodAdmin string
// AuthUsersAdmin is a map of username:password for basic auth
AuthUsersAdmin map[string]string
// Logger is the logger to use
Logger *zerolog.Logger
// RPS is the rate limit for the API
RPS float64
}
Config struct is corresponding to the YAML payload in api section of the config file
Click to show internal directories.
Click to hide internal directories.