nodedaemon

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package nodedaemon contains the entrypoint for webmesh nodes running as an application daemon.

Package nodecmd contains the entrypoint for webmesh nodes.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotConnected is returned when the node is not connected to the mesh.
	ErrNotConnected = status.Errorf(codes.FailedPrecondition, "not connected")
	// ErrAlreadyConnected is returned when the node is already connected to the mesh.
	ErrAlreadyConnected = status.Errorf(codes.FailedPrecondition, "already connected")
	// ErrAlreadyConnecting is returned when the node is already connecting to the mesh.
	ErrAlreadyConnecting = status.Errorf(codes.FailedPrecondition, "already connecting")
)

Functions

func DefaultDaemonSocket

func DefaultDaemonSocket() string

DefaultDaemonSocket returns the default daemon socket path.

func Run

func Run(ctx context.Context, conf Config) error

Run runs the app daemon with the given configuration. The context can be used to shutdown the server, otherwise it will wait for a SIGINT or SIGTERM.

Types

type AppDaemon

type AppDaemon struct {
	v1.UnimplementedAppDaemonServer
	// contains filtered or unexported fields
}

AppDaemon is the app daemon RPC server.

func (*AppDaemon) AnnounceDHT

func (app *AppDaemon) AnnounceDHT(ctx context.Context, req *v1.AnnounceDHTRequest) (*v1.AnnounceDHTResponse, error)

func (*AppDaemon) Connect

func (app *AppDaemon) Connect(ctx context.Context, req *v1.ConnectRequest) (*v1.ConnectResponse, error)

func (*AppDaemon) Disconnect

func (app *AppDaemon) Disconnect(ctx context.Context, _ *v1.DisconnectRequest) (*v1.DisconnectResponse, error)

func (*AppDaemon) LeaveDHT

func (app *AppDaemon) LeaveDHT(ctx context.Context, req *v1.LeaveDHTRequest) (*v1.LeaveDHTResponse, error)

func (*AppDaemon) Metrics

func (app *AppDaemon) Metrics(ctx context.Context, _ *v1.MetricsRequest) (*v1.MetricsResponse, error)

func (*AppDaemon) Publish

func (app *AppDaemon) Publish(ctx context.Context, req *v1.PublishRequest) (*v1.PublishResponse, error)

func (*AppDaemon) Query

func (app *AppDaemon) Query(req *v1.QueryRequest, stream v1.AppDaemon_QueryServer) error

func (*AppDaemon) Status

func (app *AppDaemon) Status(ctx context.Context, _ *v1.StatusRequest) (*v1.StatusResponse, error)

func (*AppDaemon) Subscribe

func (app *AppDaemon) Subscribe(req *v1.SubscribeRequest, srv v1.AppDaemon_SubscribeServer) error

type Config

type Config struct {
	// Bind is the bind address for the daemon.
	Bind string
	// InsecureSocket uses an insecure socket when binding to a unix socket.
	InsecureSocket bool
	// GRPCWeb enables gRPC-Web support.
	GRPCWeb bool
	// Config is the configuration of the node.
	Config *config.Config
}

Config is the configuration for the applicaton daeemon.

Jump to

Keyboard shortcuts

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