Versions in this module Expand all Collapse all v1 v1.2.1 Feb 14, 2023 Changes in this version + var ErrConnStr = errors.New("server: invalid connection string") + var ErrCreateKey = errors.New("server: failed to create a key on the fly") + var ErrExecTmpl = &APIError + var ErrFetchingConfiguration = errors.New("server: error fetching configuration") + var ErrGetKey = errors.New("server: failed to get the key") + var ErrUnexpectedBody = errors.New("server: unexpected configuration response body") + type APIError struct + Err string + Status int + func (e *APIError) Error() string + type DBParams struct + DBCollName string + DBConnString string + DBName string + type HandlerFuncErr func(w http.ResponseWriter, r *http.Request) error + type Server struct + func New(ctx context.Context, dbParams DBParams, tmpls templates.Map) (*Server, error) + 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