darkrpc

package
v1.64.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const DarkstatRpcSock = "/tmp/darkstat/rpc.sock"

Variables

This section is empty.

Functions

func EntityToYamlStrings added in v1.64.0

func EntityToYamlStrings(entity any) []string

Types

type Args

type Args struct {
}

type ClientOpt

type ClientOpt func(r *ClientRpc)

func WithSockCli

func WithSockCli(sock string) ClientOpt

type ClientRpc

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

/ CLIENT///////////////////

func (*ClientRpc) GetBases

func (r *ClientRpc) GetBases(args Args, reply *Reply) error

func (*ClientRpc) GetHealth

func (r *ClientRpc) GetHealth(args Args, reply *bool) error

func (*ClientRpc) GetInfo added in v1.64.0

func (r *ClientRpc) GetInfo(args GetInfoArgs, reply *GetInfoReply) error

type GetInfoArgs added in v1.64.0

type GetInfoArgs struct {
	Query string
}

type GetInfoReply added in v1.64.0

type GetInfoReply struct {
	Content []string
	Found   []InfoFound
}

type InfoFound added in v1.64.0

type InfoFound struct {
	Nickname   string
	Name       string
	Entity     string
	FirstLine  string
	Obtainable bool
}

type Reply

type Reply struct {
	Bases []*configs_export.Base
}

type RpcI

type RpcI interface {
	GetBases(args Args, reply *Reply) error
	GetHealth(args Args, reply *bool) error
	GetInfo(args GetInfoArgs, reply *GetInfoReply) error
}

func NewClient

func NewClient(opts ...ClientOpt) RpcI

func NewRpc

func NewRpc(app_data *appdata.AppData) RpcI

type RpcServer

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

func NewRpcServer

func NewRpcServer(opts ...ServerOpt) *RpcServer

func (*RpcServer) Close

func (r *RpcServer) Close()

func (*RpcServer) Serve

func (r *RpcServer) Serve(app_data *appdata.AppData)

type ServerOpt

type ServerOpt func(r *RpcServer)

func WithPortSrv

func WithPortSrv(port int) ServerOpt

func WithSockSrv

func WithSockSrv(sock string) ServerOpt

type ServerRpc

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

func (*ServerRpc) GetBases

func (t *ServerRpc) GetBases(args Args, reply *Reply) error

func (*ServerRpc) GetHealth

func (t *ServerRpc) GetHealth(args Args, reply *bool) error

func (*ServerRpc) GetInfo added in v1.64.0

func (t *ServerRpc) GetInfo(args GetInfoArgs, reply *GetInfoReply) error

func (*ServerRpc) IsInfoFound added in v1.64.0

func (t *ServerRpc) IsInfoFound(args GetInfoArgs, name string, nickname string) (bool, bool)

func (*ServerRpc) NewInfoFound added in v1.64.0

func (t *ServerRpc) NewInfoFound(Nickname string, Name string, Entity string, Obtainable bool) InfoFound

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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