server

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG = uint8(iota)
	INFO
	WARN
	ERR
	FATAL
)

log levels

Variables

This section is empty.

Functions

This section is empty.

Types

type IO added in v0.1.0

type IO interface {
	Logger(level uint8, format string, args ...interface{})
	GetInputFeed() chan InMsg
	GetOutputFeed() chan string
	GetContext() context.Context
}

IO provides a common interface to work with dnspot. Any CLI/Web/WASM app can deploy the 4 functions and act as a frontend for dnspot server

type InMsg added in v0.1.0

type InMsg struct {
	Prompt string
	Agent  string
}

InMsg is a message coming from the frontend

type Server added in v0.1.0

type Server struct {
	PrivateKeyBase36 string

	ListenAddress            string
	EnforceClientKeys        bool
	AcceptedClientKeysBase36 []string

	DNSSuffix string
	Mode      string
	// contains filtered or unexported fields
}

Server contains all the runtime configuration of a dnspot Command and Control server

func New added in v0.1.0

func New() Server

New returns a new Server object

func (Server) ListAgents added in v0.1.0

func (s Server) ListAgents() []string

ListAgents returns a list of agents connected to the server

func (*Server) RunServer added in v0.1.0

func (s *Server) RunServer(serverIO IO) error

RunServer creates a new Server instance. This function is blocking and follows the "ListenAndServe" model

Jump to

Keyboard shortcuts

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