Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartWebServer ¶
StartWebServer starts the HTTP service and listens for the admin requests
Types ¶
type Data ¶
type Data struct { Port int KeySaver KeyCreator KeyGetter KeyRetriever OneKeyGetter OneKeyRetriever LogProvider LogProvider OneKeyUpdater KeyUpdater UsageRestorer UsageRestorer UsageReseter UsageReseter ProjectValidator PrValidator CmsData *cms.Data }
Data is service operation data
type KeyCreator ¶
KeyCreator creates key
type KeyRetriever ¶
KeyRetriever gets keys list from db
type KeyUpdater ¶
KeyUpdater creates key
type LogProvider ¶
type LogProvider interface { Get(string, string) ([]*adminapi.Log, error) List(string, time.Time) ([]*adminapi.Log, error) Delete(string, time.Time) (int, error) }
LogRetriever retrieves one list from db
type OneKeyRetriever ¶
OneKeyRetriever retrieves one list from db
type PrValidator ¶
PrValidator validates if project is available
type ProjectConfigValidator ¶
type ProjectConfigValidator struct {
// contains filtered or unexported fields
}
ProjectConfigValidator loads available projects from config
func NewProjectConfigValidator ¶
func NewProjectConfigValidator(projects string) (*ProjectConfigValidator, error)
NewProjectConfigValidator creates project validator, reads available projects from config
func (*ProjectConfigValidator) Check ¶
func (pv *ProjectConfigValidator) Check(pr string) bool
Check tests if project is available
func (*ProjectConfigValidator) Projects ¶
func (pv *ProjectConfigValidator) Projects() []string
Projects returns all supported projects
Click to show internal directories.
Click to hide internal directories.