admin

package
v0.0.0-...-ed45d8a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package admin provides a password protected https server to send commands to a running dex server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger sets the logger for the admin package.

Types

type Server

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

Server is a multi-client https server.

func NewServer

func NewServer(cfg *SrvConfig) (*Server, error)

NewServer is the constructor for a new Server.

func (*Server) Run

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

Run starts the server.

type SrvConfig

type SrvConfig struct {
	Core            SvrCore
	Addr, Cert, Key string
	AuthSHA         [32]byte
}

SrvConfig holds variables needed to create a new Server.

type SvrCore

type SvrCore interface {
	Accounts() (accts []*db.Account, err error)
	AccountInfo(acctID account.AccountID) (*db.Account, error)
	Notify(acctID account.AccountID, msg *msgjson.Message)
	NotifyAll(msg *msgjson.Message)
	ConfigMsg() json.RawMessage
}

SvrCore is satisfied by server/dex.DEX.

Jump to

Keyboard shortcuts

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