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



    This section is empty.


    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.


      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)


        type Config

        type Config struct {
        	Database      database.Config
        	KeyManager    keys.Config
        	SecretManager secrets.Config
        	Storage       storage.Config
        	Port         string `env:"PORT, default=8080"`
        	TemplatePath string `env:"TEMPLATE_DIR, default=./cmd/admin-console/templates"`
        	TopFile      string `env:"TOP_FILE, default=top"`
        	BotFile      string `env:"BOTTOM_FILE, default=bottom"`

        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) RenderTemplate

        func (c *Config) RenderTemplate(w http.ResponseWriter, tmpl string, p TemplateMap) error

        func (*Config) SecretManagerConfig

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

        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

          type Server struct {
          	// contains filtered or unexported fields

            Server is the debugger server.

            func NewServer

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

              NewServer makes a new admin console server.

              func (*Server) HandleAuthorizedAppsSave

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

                HandleAuthorizedAppsSave handles the create/update actions for authorized apps.

                func (*Server) HandleAuthorizedAppsShow

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

                  HandleAuthorizedAppsShow handles the show page for authorized apps.

                  func (*Server) HandleExportImportersSave

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

                    HandleExportImportersSave handles the create/update actions for export importers.

                    func (*Server) HandleExportImportersShow

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

                      HandleExportImportersShow handles the create/update actions for export importers.

                      func (*Server) HandleExportsSave

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

                        HandleExportsSave handles the create/update actions for exports.

                        func (*Server) HandleExportsShow

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

                          HandleExportsShow handles the show action for exports.

                          func (*Server) HandleHealthAuthorityKeys

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

                            HandleHealthAuthorityKeys handles the keys action for health authorities.

                            func (*Server) HandleHealthAuthoritySave

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

                              HandleHealthAuthoritySave handles the create/update actions for health authorities.

                              func (*Server) HandleHealthAuthorityShow

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

                                HandleHealthAuthorityShow handles the show action for health authorities.

                                func (*Server) HandleHealthz

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

                                func (*Server) HandleIndex

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

                                func (*Server) HandleMirrorsSave

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

                                  HandleMirrorsSave handles the create/update actions for mirrors.

                                  func (*Server) HandleMirrorsShow

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

                                    HandleMirrorsShow handles the show action for mirrors.

                                    func (*Server) HandleSignatureInfosSave

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

                                      HandleSignatureInfosSave handles the create/update actions for signature infos.

                                      func (*Server) HandleSignatureInfosShow

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

                                        HandleSignatureInfosShow handles the show action for signature infos.

                                        func (*Server) Routes

                                        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) AddSubNav

                                        func (t TemplateMap) AddSubNav(name string)

                                        func (TemplateMap) AddSuccess

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

                                        func (TemplateMap) AddTitle

                                        func (t TemplateMap) AddTitle(title string)