trustedcgi

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config description for new trusted-cgi instance.

func Default

func Default() *Config

Creates default parameters for trusted-cgi instance.

func (*Config) Context

func (cfg *Config) Context(ctx context.Context) *Config

Parent context.

func (*Config) Directory

func (cfg *Config) Directory(dir string) *Config

Directory for project files.

func (*Config) New

func (cfg *Config) New() (*Instance, error)

New instance of trusted-cgi using defaults storages and implementations. Also initializes SSH key (if enabled). Starts supporting go-routines that will be stopped when context will be canceled. The Done() channel can be used to determinate sub-routine termination. Global context could be nil - the Background will be used.

func (*Config) Password

func (cfg *Config) Password(password string) *Config

Password for admin account if not yet set.

func (*Config) SSH

func (cfg *Config) SSH(enable bool) *Config

SSH support enable or disable. By default - enabled.

type Instance

type Instance struct {
	Location string // location as-is it used during initialization
	// contains filtered or unexported fields
}

func (*Instance) Context

func (instance *Instance) Context() context.Context

Context used for control instance lifecycle.

func (*Instance) Done

func (instance *Instance) Done() <-chan struct{}

Returns channel that will be closed once all sub-routine (tracker dump and scheduler) finished.

func (*Instance) Handler

func (instance *Instance) Handler() http.Handler

Creates (every time new) server handlers (see Server::Handlers) using local (cancelable) context.

func (*Instance) ListenAndServe

func (instance *Instance) ListenAndServe(binding string) error

Listen and serves using provided binding - simple wrapper around Handler and http.Listen. Will shutdown in case of context cancel.

func (*Instance) ListenAndServeTLS

func (instance *Instance) ListenAndServeTLS(binding string, certFile, keyFile string) error

Listen and serves using provided binding using TLS - simple wrapper around Handler and http.ListenTLS. Will shutdown in case of context cancel.

func (*Instance) Server

func (instance *Instance) Server() *server.Server

Server initialized with all dependencies.

func (*Instance) Stop

func (instance *Instance) Stop()

Cancel underlying context and waits for finish.

Jump to

Keyboard shortcuts

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