shareasecret

package
v0.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

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.

Jump to

Keyboard shortcuts

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