web

package
v0.0.0-...-3f13264 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option configures a Server.

func WithAddr

func WithAddr(addr string) Option

WithAddr sets Server's address.

func WithAdmins

func WithAdmins(admins map[string]string) Option

WithAdmins sets a Server's admin accounts.

func WithDB

func WithDB(db *sql.DB) Option

WithDB sets a Server's DB connection.

func WithDebug

func WithDebug(debug bool) Option

WithDebug toggles debug mode on a Server.

func WithOAuth2

func WithOAuth2(oa *oauth2.Config) Option

WithOAuth2 sets a Server's OAuth2 config.

type Server

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

Server is the HTTP server responsible for serving BOT/2's website.

func New

func New(opts ...Option) (*Server, error)

New creates a new Server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts a Server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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