dinkurd

package
v0.0.0-...-d280c18 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package dinkurd contains a Dinkur gRPC API server daemon implementation.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUintTooLarge   = fmt.Errorf("unsigned int value is too large, maximum: %d", uint64(math.MaxUint))
	ErrDaemonIsNil    = errors.New("daemon is nil")
	ErrRequestIsNil   = errors.New("grpc request was nil")
	ErrAlreadyServing = errors.New("daemon instance is already running")
)

Errors that are specific to the Dinkur gRPC server daemon.

View Source
var DefaultOptions = Options{
	BindAddress: "localhost:59122",
}

DefaultOptions values are used for any zero values used when creating a new daemon instance.

Functions

This section is empty.

Types

type Daemon

type Daemon interface {
	// Serve starts the gRPC server and waits. The function does not return
	// unless the context is cancelled, or if there was an error.
	Serve(ctx context.Context) error
	// Close gracefully shuts down the daemon server.
	Close() error
}

Daemon is the Dinkur daemon service interface.

func NewDaemon

func NewDaemon(client dinkur.Client, opt Options) Daemon

NewDaemon creates a new Daemon instance that relays all gRPC traffic to the given dinkur.Client. This daemon implementation does not perform any database communication nor has any persistence in of itself. This daemon must be paired with a dinkur.Client such as the dinkurdb client to talk to an Sqlite3 database file, or the dinkurclient client to act as a proxy.

Both the global DefaultOptions and the opt parameter is used. The DefaultOptions values are only used for any zero valued fields in the opt parameter.

type Options

type Options struct {
	// BindAddress is the hostname/IP and port to bind the server to.
	// Use 0.0.0.0 for IP to allow any IP address.
	BindAddress string
}

Options for the daemon server.

Jump to

Keyboard shortcuts

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