admin

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package admin provides a small admin UI. Requires connection to the database and permissions to access whatever else you might need to access.

Index

Constants

This section is empty.

Variables

View Source
var TemplateFuncMap = template.FuncMap{
	"deref":        deref,
	"htmlDate":     timestampFormatter("2006-01-02"),
	"htmlTime":     timestampFormatter("15:04"),
	"htmlDatetime": timestampFormatter(time.UnixDate),
}

TemplateFuncMap is the list of template functions.

Functions

func CombineDateAndTime

func CombineDateAndTime(dateS, timeS string) (time.Time, error)

CombineDateAndTime takes values from date and time HTML inputs and combines them to a single date time.

func ErrorPage

func ErrorPage(c *gin.Context, messages ...string)

Types

type Config

type Config struct {
	Database      database.Config
	KeyManager    keys.Config
	SecretManager secrets.Config
	Storage       storage.Config

	Port string `env:"PORT, default=8080"`
}

func (*Config) BlobstoreConfig

func (c *Config) BlobstoreConfig() *storage.Config

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Config

func (*Config) KeyManagerConfig

func (c *Config) KeyManagerConfig() *keys.Config

func (*Config) SecretManagerConfig

func (c *Config) SecretManagerConfig() *secrets.Config

func (*Config) TemplateRenderer added in v0.23.0

func (c *Config) TemplateRenderer() (*template.Template, error)

type Controller

type Controller interface {
	Execute(g *gin.Context)
}

Controller is the interfactor for controllers that can be pluggied into Gin for the admin console portion of this project.

type Server added in v0.20.0

type Server struct {
	// contains filtered or unexported fields
}

Server is the admin server.

func NewServer added in v0.20.0

func NewServer(config *Config, env *serverenv.ServerEnv) (*Server, error)

NewServer makes a new admin console server.

func (*Server) HandleAuthorizedAppsSave added in v0.20.0

func (s *Server) HandleAuthorizedAppsSave() func(c *gin.Context)

HandleAuthorizedAppsSave handles the create/update actions for authorized apps.

func (*Server) HandleAuthorizedAppsShow added in v0.20.0

func (s *Server) HandleAuthorizedAppsShow() func(c *gin.Context)

HandleAuthorizedAppsShow handles the show page for authorized apps.

func (*Server) HandleExportImportKeys added in v0.24.0

func (s *Server) HandleExportImportKeys() func(c *gin.Context)

func (*Server) HandleExportImportersSave added in v0.20.0

func (s *Server) HandleExportImportersSave() func(c *gin.Context)

HandleExportImportersSave handles the create/update actions for export importers.

func (*Server) HandleExportImportersShow added in v0.20.0

func (s *Server) HandleExportImportersShow() func(c *gin.Context)

HandleExportImportersShow handles the create/update actions for export importers.

func (*Server) HandleExportsSave added in v0.20.0

func (s *Server) HandleExportsSave() func(c *gin.Context)

HandleExportsSave handles the create/update actions for exports.

func (*Server) HandleExportsShow added in v0.20.0

func (s *Server) HandleExportsShow() func(c *gin.Context)

HandleExportsShow handles the show action for exports.

func (*Server) HandleHealthAuthorityKeys added in v0.20.0

func (s *Server) HandleHealthAuthorityKeys() func(c *gin.Context)

HandleHealthAuthorityKeys handles the keys action for health authorities.

func (*Server) HandleHealthAuthoritySave added in v0.20.0

func (s *Server) HandleHealthAuthoritySave() func(c *gin.Context)

HandleHealthAuthoritySave handles the create/update actions for health authorities.

func (*Server) HandleHealthAuthorityShow added in v0.20.0

func (s *Server) HandleHealthAuthorityShow() func(c *gin.Context)

HandleHealthAuthorityShow handles the show action for health authorities.

func (*Server) HandleHealthz added in v0.20.0

func (s *Server) HandleHealthz() func(c *gin.Context)

func (*Server) HandleIndex added in v0.20.0

func (s *Server) HandleIndex() func(c *gin.Context)

func (*Server) HandleMirrorsSave added in v0.20.0

func (s *Server) HandleMirrorsSave() func(c *gin.Context)

HandleMirrorsSave handles the create/update actions for mirrors.

func (*Server) HandleMirrorsShow added in v0.20.0

func (s *Server) HandleMirrorsShow() func(c *gin.Context)

HandleMirrorsShow handles the show action for mirrors.

func (*Server) HandleSignatureInfosSave added in v0.20.0

func (s *Server) HandleSignatureInfosSave() func(c *gin.Context)

HandleSignatureInfosSave handles the create/update actions for signature infos.

func (*Server) HandleSignatureInfosShow added in v0.20.0

func (s *Server) HandleSignatureInfosShow() func(c *gin.Context)

HandleSignatureInfosShow handles the show action for signature infos.

func (*Server) Routes added in v0.20.0

func (s *Server) Routes(ctx context.Context) http.Handler

type TemplateMap

type TemplateMap map[string]interface{}

func (TemplateMap) AddErrors

func (t TemplateMap) AddErrors(errors ...string)

func (TemplateMap) AddSuccess

func (t TemplateMap) AddSuccess(success ...string)

func (TemplateMap) AddTitle

func (t TemplateMap) AddTitle(title string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL