Documentation
¶
Overview ¶
templ: version: v0.2.680
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is a wrapper/container for the "ShareASecret" project. All jobs and entry points hang off of this struct.
func NewApplication ¶
func NewApplication(config *Configuration, webAssets fs.FS) (*Application, error)
NewApplication initializes the Application struct which provides access to all available components of the project.
func (*Application) RunDeleteExpiredSecretsJob ¶
func (a *Application) RunDeleteExpiredSecretsJob()
RunDeleteExpiredSecretsJob runs a background job that identifies expired secrets and removes them accordingly
func (*Application) ServeHTTP ¶
func (a *Application) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the root http.Handler method for the application. It serves all application routes, wrapping them with any required middlewares
type Configuration ¶
type Configuration struct { Database struct { Path string } Server struct { BaseUrl string ListeningAddr string } SecretCreationRestrictions struct { IPAddresses []string } }
Configuration contains all of the possible configuration options for the application.
func (*Configuration) PopulateFromEnv ¶
func (c *Configuration) PopulateFromEnv() error
PopulateFromEnv populates all of the configuration values from environment variables, returning errors if this cannot be achieved.