passwdrpc

package
v0.0.0-...-44b4573 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPort is the port number the daemon will listen on in the absence of port number specified by user.
	DefaultPort = 16
	// TestPort is used exclusively by test cases to configure daemon under testing.
	TestPort = 18378
)

Variables

This section is empty.

Functions

func TestPasswdRPCDaemon

func TestPasswdRPCDaemon(daemon *Daemon, t testingstub.T)

TestPasswdRPCDaemon is used exclusively by test case to run a comprehensive test routine for the daemon control functions. The daemon must have already been completed with all of its configuration and successfully initialised. See passwdrpc_test.go for the daemon initialisation routine.

Types

type Daemon

type Daemon struct {
	// Address is the IP address to listen on, e.g. 0.0.0.0 to listen on all network interfaces.
	Address string `json:"Address"`
	// Port to listen on.
	Port int `json:"Port"`

	// TLSCertPath is the path in file system pointing to the TLS certificate, this is optional.
	TLSCertPath string `json:"TLSCertPath"`
	// TLSCertPath is the path in file system pointing to the TLS certificate key, this is optional.
	TLSKeyPath string `json:"TLSKeyPath"`

	// PasswordRegister is the gRPC service implementation that handles RPC calls on-the-wire.
	PasswordRegister *netboundfileenc.PasswordRegister `json:"-"`
	// contains filtered or unexported fields
}

Daemon offers a network listener for a gRPC service that allows other laitos program instances to obtain password for unlocking their encrypted config/data files.

func (*Daemon) Initialise

func (daemon *Daemon) Initialise() error

Initialise validates configuration parameters and initialises the internal states of the daemon.

func (*Daemon) StartAndBlock

func (daemon *Daemon) StartAndBlock() error

StartAndBlock starts a network listener and serves incoming requests using the embedded gRPC server. The function will block caller until Stop is called.

func (*Daemon) Stop

func (daemon *Daemon) Stop()

Stop the daemon, its network listener, and embedded gRPC server.

Jump to

Keyboard shortcuts

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