server

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenBoardServer added in v0.4.0

func NewTokenBoardServer(store storage.MessageStoreInterface, tokenService *privacypass.TokenServer) tapir.Application

NewTokenBoardServer generates new Server for Token Board

Types

type Config

type Config struct {
	ConfigDir      string `json:"-"`
	FilePath       string `json:"-"`
	MaxBufferLines int    `json:"maxBufferLines"`

	PublicKey  ed25519.PublicKey  `json:"publicKey"`
	PrivateKey ed25519.PrivateKey `json:"privateKey"`

	TokenServerPublicKey  ed25519.PublicKey  `json:"tokenServerPublicKey"`
	TokenServerPrivateKey ed25519.PrivateKey `json:"tokenServerPrivateKey"`

	TokenServiceK ristretto255.Scalar `json:"tokenServiceK"`

	ServerReporting Reporting `json:"serverReporting"`
	AutoStart       bool      `json:"autostart"`
}

Config is a struct for storing basic server configuration

func LoadConfig

func LoadConfig(configDir, filename string) Config

LoadConfig loads a Config from a json file specified by filename

func (*Config) Identity

func (config *Config) Identity() primitives.Identity

Identity returns an encapsulation of the servers keys

func (*Config) Save

func (config *Config) Save(dir, filename string)

Save dumps the latest version of the config to a json file given by filename

func (*Config) TokenServiceIdentity added in v0.4.0

func (config *Config) TokenServiceIdentity() primitives.Identity

TokenServiceIdentity returns an encapsulation of the servers token server (experimental)

type Reporting

type Reporting struct {
	LogMetricsToFile    bool   `json:"logMetricsToFile"`
	ReportingGroupID    string `json:"reportingGroupId"`
	ReportingServerAddr string `json:"reportingServerAddr"`
}

Reporting is a struct for storing a the config a server needs to be a peer, and connect to a group to report

type Server

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

Server encapsulates a complete, compliant Cwtch server.

func (*Server) CheckStatus added in v0.4.7

func (s *Server) CheckStatus() (bool, error)

CheckStatus returns true if the server is running and/or an error if any part of the server needs to be restarted.

func (*Server) Close added in v0.7.1

func (s *Server) Close()

Close shuts down the cwtch server in a safe way.

func (*Server) ConfigureAutostart added in v0.4.7

func (s *Server) ConfigureAutostart(autostart bool)

ConfigureAutostart sets whether this server should autostart (in the Cwtch UI/bundling application)

func (*Server) GetStatistics added in v0.4.7

func (s *Server) GetStatistics() Statistics

GetStatistics is a stub method for providing some high level information about the server operation to bundling applications (e.g. the UI)

func (*Server) Identity added in v0.4.7

func (s *Server) Identity() primitives.Identity

Identity returns the main onion identity of the server

func (*Server) KeyBundle added in v0.4.0

func (s *Server) KeyBundle() *model.KeyBundle

KeyBundle provides the signed keybundle of the server

func (*Server) Run

func (s *Server) Run(acn connectivity.ACN) error

Run starts a server with the given privateKey

func (*Server) Setup added in v0.4.0

func (s *Server) Setup(serverConfig Config)

Setup initialized a server from a given configuration

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown kills the app closing all connections and freeing all goroutines

type Statistics added in v0.4.7

type Statistics struct {
	TotalMessages int
}

Statistics is an encapsulation of information about the server that an operator might want to know at a glance.

type TokenboardServer added in v0.4.0

type TokenboardServer struct {
	applications.AuthApp

	TokenService       *privacypass.TokenServer
	LegacyMessageStore storage.MessageStoreInterface
	// contains filtered or unexported fields
}

TokenboardServer defines the token board server

func (*TokenboardServer) Init added in v0.4.0

func (ta *TokenboardServer) Init(connection tapir.Connection)

Init initializes the cryptographic TokenBoardApp

func (*TokenboardServer) Listen added in v0.4.0

func (ta *TokenboardServer) Listen()

Listen processes the messages for this application

func (*TokenboardServer) NewInstance added in v0.4.0

func (ta *TokenboardServer) NewInstance() tapir.Application

NewInstance creates a new TokenBoardApp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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