system

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAttempts = 3

Variables

View Source
var ErrBadCredentials = errors.New("bad credentials")
View Source
var ErrExists = errors.New("record already exists")
View Source
var ErrNotFound = errors.New("not found")

Functions

func ReverseProxyHandler added in v0.0.4

func ReverseProxyHandler(config config.Config, path, dest string) (http.Handler, error)

Types

type Info

type Info struct {
	Contact string `json:"contact"`
}

type Integrations added in v0.0.5

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

type JSONError

type JSONError struct {
	Error string `json:"error"`
}

type LoginPacket

type LoginPacket struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type RPC added in v0.0.5

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

func (*RPC) Foo added in v0.0.5

func (r *RPC) Foo(arg string, reply *string) error

type SignupPacket

type SignupPacket struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type Stats

type Stats struct {
	Hits    uint64  `json:"hits"`
	Average float64 `json:"hits-per-second,omitempty"`

	Uptime float64 `json:"uptime,omitempty"`
	// contains filtered or unexported fields
}

type System

type System struct {
	Stats Stats
	Info  Info
	// contains filtered or unexported fields
}

func New

func New(conf *config.Config) (*System, error)

func (*System) ApiHandler

func (s *System) ApiHandler(w http.ResponseWriter, r *http.Request)

func (*System) Close added in v0.0.5

func (s *System) Close() error

func (*System) Config added in v0.0.5

func (s *System) Config() config.Config

func (*System) DashboardHandler

func (s *System) DashboardHandler(w http.ResponseWriter, r *http.Request)

func (*System) ErrHandler

func (s *System) ErrHandler(w http.ResponseWriter, r *http.Request)

func (*System) HandleForm added in v0.0.5

func (s *System) HandleForm(w http.ResponseWriter, r *http.Request)

func (*System) HitCounter

func (s *System) HitCounter(h http.Handler) http.Handler

HitCounter http middleware that logs and counts

func (*System) HomeHandler

func (s *System) HomeHandler(w http.ResponseWriter, r *http.Request)

func (*System) InitDB

func (s *System) InitDB() error

initialize database connections and create buckets

func (*System) LoginHandler

func (s *System) LoginHandler(w http.ResponseWriter, r *http.Request)

func (*System) LogoutHandler

func (s *System) LogoutHandler(w http.ResponseWriter, r *http.Request)

func (*System) NewRPC added in v0.0.5

func (s *System) NewRPC() *RPC

func (*System) ReloadConfig added in v0.0.3

func (s *System) ReloadConfig() error

func (*System) ReloadTemplates added in v0.0.3

func (s *System) ReloadTemplates() error

func (*System) Respawn added in v0.0.5

func (s *System) Respawn() error

func (*System) Run added in v0.0.5

func (s *System) Run(router http.Handler) error

func (*System) SetCSPHeader

func (s *System) SetCSPHeader(w http.ResponseWriter)

func (*System) SetGreylist

func (s *System) SetGreylist(g *greylist.List)

func (*System) SignupHandler

func (s *System) SignupHandler(w http.ResponseWriter, r *http.Request)

func (*System) StaticHandler

func (s *System) StaticHandler(w http.ResponseWriter, r *http.Request)

func (*System) StatusHandler

func (s *System) StatusHandler(w http.ResponseWriter, r *http.Request)

type User

type User struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	// contains filtered or unexported fields
}

func (User) String

func (u User) String() string

Jump to

Keyboard shortcuts

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