web

package
v0.0.0-...-0714773 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTemplates

func LoadTemplates(box string, name []string) (*template.Template, error)

LoadTemplates a template from the rice box

Types

type Auth

type Auth interface {
	VerifyLogin(username, password string) (bool, error)
	Type() string
}

Auth provides a interface for Authentication

type AuthConfig

type AuthConfig struct {
	Password *AuthPassword `json:"password" toml:"password" yaml:"password"`
	LDAP     *AuthLDAP     `json:"ldap" toml:"ldap" yaml:"ldap"`
}

AuthConfig contains the authentication configuration for web interface

type AuthLDAP

type AuthLDAP struct {
	Host      string              `json:"host" toml:"host" yaml:"host"`       // address to connect to
	Port      int                 `json:"port" toml:"port" yaml:"port"`       // port to connect to
	Method    string              `json:"method" toml:"method" yaml:"method"` // connect method (SSL/TLS)
	Domain    string              `json:"domain" toml:"domain" yaml:"domain"` // binddn
	Filter    string              `json:"filter" toml:"filter" yaml:"filter"` // binddn
	BindDN    string              `json:"binddn" toml:"binddn" yaml:"binddn"` // binddn
	TLSConfig tlsconfig.TLSConfig `json:"tls" toml:"tls" yaml:"tls"`
	// contains filtered or unexported fields
}

AuthLDAP is the provider for LDAP based authentication for the web service

func (*AuthLDAP) Type

func (a *AuthLDAP) Type() string

Type is the authentication type

func (*AuthLDAP) VerifyLogin

func (a *AuthLDAP) VerifyLogin(username, password string) (bool, error)

VerifyLogin validates a user/password combination and returns true or false accordingly

type AuthPassword

type AuthPassword struct {
	Users map[string]string `json:"users" toml:"users" yaml:"users"`
}

AuthPassword is the provider for Password based authentication for the web service

func NewAuthPassword

func NewAuthPassword(users map[string]string) *AuthPassword

NewAuthPassword provides a authentication provider for Passwords

func (*AuthPassword) Type

func (a *AuthPassword) Type() string

Type is the authentication type

func (*AuthPassword) VerifyLogin

func (a *AuthPassword) VerifyLogin(username, password string) (bool, error)

VerifyLogin validates a user/password combination and returns true or false accordingly

type Config

type Config struct {
	Binding   string              `toml:"binding" json:"binding"`
	Port      int                 `toml:"port" json:"port"`
	Path      string              `toml:"path" json:"path"`
	TLSConfig tlsconfig.TLSConfig `json:"tls" toml:"tls" yaml:"tls"`
	Auth      AuthConfig          `json:"auth" toml:"auth" yaml:"auth"`
}

Config for WEB

type Page

type Page struct {
	Title    string
	URI      string
	Hostname string
	Time     time.Time
	Username string
}

Page data

Jump to

Keyboard shortcuts

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