Documentation ¶
Overview ¶
Package daemoncmd contains the entrypoint for webmesh nodes running as an application daemon.
Index ¶
- Variables
- func DefaultDaemonSocket() string
- func Run(ctx context.Context, conf Config) error
- type AppDaemon
- func (app *AppDaemon) Close() error
- func (app *AppDaemon) Connect(ctx context.Context, req *v1.ConnectRequest) (*v1.ConnectResponse, error)
- func (app *AppDaemon) Disconnect(ctx context.Context, req *v1.DisconnectRequest) (*v1.DisconnectResponse, error)
- func (app *AppDaemon) Metrics(ctx context.Context, req *v1.MetricsRequest) (*v1.MetricsResponse, error)
- func (app *AppDaemon) Query(ctx context.Context, req *v1.AppQueryRequest) (*v1.QueryResponse, error)
- func (app *AppDaemon) Status(ctx context.Context, req *v1.StatusRequest) (*v1.StatusResponse, error)
- type Config
- type WebUI
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 to the specified network") // ErrAlreadyConnected is returned when the node is already connected to the mesh. ErrAlreadyConnected = status.Errorf(codes.FailedPrecondition, "already connected to the specified network") )
Functions ¶
func DefaultDaemonSocket ¶
func DefaultDaemonSocket() string
DefaultDaemonSocket returns the default daemon socket path.
Types ¶
type AppDaemon ¶
type AppDaemon struct { v1.UnimplementedAppDaemonServer // contains filtered or unexported fields }
AppDaemon is the app daemon RPC server.
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, req *v1.DisconnectRequest) (*v1.DisconnectResponse, error)
func (*AppDaemon) Metrics ¶
func (app *AppDaemon) Metrics(ctx context.Context, req *v1.MetricsRequest) (*v1.MetricsResponse, error)
func (*AppDaemon) Query ¶
func (app *AppDaemon) Query(ctx context.Context, req *v1.AppQueryRequest) (*v1.QueryResponse, error)
func (*AppDaemon) Status ¶
func (app *AppDaemon) Status(ctx context.Context, req *v1.StatusRequest) (*v1.StatusResponse, error)
type Config ¶
type Config struct { // Enabled is true if the daemon is enabled. Enabled bool `koanf:"enabled"` // NodeID is the ID to use for mesh connections from this server. // If not provided, one will be generated from the key. NodeID string `koanf:"node-id"` // KeyFile is the path to the WireGuard private key for the node. // If set and it does not exist it will be created, otherwise one // will be generated. KeyFile string `koanf:"key-file,omitempty"` // Bind is the bind address for the daemon. Bind string `koanf:"bind"` // InsecureSocket uses an insecure socket when binding to a unix socket. InsecureSocket bool `koanf:"insecure-socket"` // GRPCWeb enables gRPC-Web support. GRPCWeb bool `koanf:"grpc-web"` // UI are options for exposing a gRPC UI. UI WebUI `koanf:"ui"` // LogLevel is the log level for the daemon. LogLevel string `koanf:"log-level"` // LogFormat is the log format for the daemon. LogFormat string `koanf:"log-format"` }
Config is the configuration for the applicaton daeemon.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns the default configuration.
func (*Config) LoadKey ¶
func (conf *Config) LoadKey() (crypto.PrivateKey, error)
LoadKey loads the wireguard key from the configuration.
Click to show internal directories.
Click to hide internal directories.