Documentation ¶
Index ¶
- Variables
- type APIError
- type DBParams
- type HandlerFuncErr
- type Server
- func (s *Server) Fill(ctx context.Context, maxCount int64, sleepDuration time.Duration)
- func (s *Server) GetKey(ctx context.Context) (*models.Account, error)
- func (s *Server) HandleGenerateKey() http.HandlerFunc
- func (s *Server) HandleHomePage() http.HandlerFunc
- func (s *Server) HandleUpdateConfig() http.HandlerFunc
- func (s *Server) ListenAndServe(listenAddr string) error
- func (s *Server) UpdateConfiguration(ctx context.Context) error
- func (s *Server) WrapHandlerFuncErr(f HandlerFuncErr) http.HandlerFunc
- func (s *Server) WriteErr(w http.ResponseWriter, e *APIError) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGetKey = errors.New("server: failed to get the key") ErrConnStr = errors.New("server: invalid connection string") ErrFetchingConfiguration = errors.New("server: error fetching configuration") ErrCreateKey = errors.New("server: failed to create a key on the fly") ErrUnexpectedBody = errors.New("server: unexpected configuration response body") )
View Source
var ErrExecTmpl = &APIError{Err: "failed to exec tmpl", Status: http.StatusInternalServerError}
Functions ¶
This section is empty.
Types ¶
type HandlerFuncErr ¶
type HandlerFuncErr func(w http.ResponseWriter, r *http.Request) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleGenerateKey ¶
func (s *Server) HandleGenerateKey() http.HandlerFunc
func (*Server) HandleHomePage ¶
func (s *Server) HandleHomePage() http.HandlerFunc
func (*Server) HandleUpdateConfig ¶
func (s *Server) HandleUpdateConfig() http.HandlerFunc
func (*Server) ListenAndServe ¶
ListenAndServe is a wrapper around (*http.Server).ListenAndServe().
func (*Server) UpdateConfiguration ¶
UpdateConfiguration fetches the most recent configuration and sets it.
func (*Server) WrapHandlerFuncErr ¶
func (s *Server) WrapHandlerFuncErr(f HandlerFuncErr) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.