rpcserver

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerAddrDefault = "127.0.0.1"
	ServerPortDefault = "4040"
)

Variables

This section is empty.

Functions

func Start

func Start(app *adele.Adele) error

func Stop

func Stop(app *adele.Adele) error

Types

type MaintenanceModeArgs

type MaintenanceModeArgs struct {
	InMaintenanceMode bool
}

type MaintenanceModeReply

type MaintenanceModeReply struct {
	Status string
}

type RPCClient

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

func NewRPCClient

func NewRPCClient() (*RPCClient, error)

Creates a new RPC connection to a server and wraps the connection in a custom RPCClient struct. The client is returned ready to use, or an error if connection fails.

func (*RPCClient) Close

func (c *RPCClient) Close() error

Closes the underlying RPC connection using a clean shutdown pattern. Any errors duing the close are passed through from the underlying close operation.

func (*RPCClient) SetMaintenanceMode

func (c *RPCClient) SetMaintenanceMode(inMaintenance bool) (string, error)

Convenience wrapper method that makes RPC calls easier and more user-friendly— the the method is used to put the server in or out of maintance mode. Example usage:

status, err := client.SetMaintenanceMode(true)  // Put in maintenance
status, err := client.SetMaintenanceMode(false) // Take out of maintenance

type RPCServer

type RPCServer struct {
	App *adele.Adele
}

Server

func (*RPCServer) SetMaintenanceMode

func (r *RPCServer) SetMaintenanceMode(args *MaintenanceModeArgs, reply *MaintenanceModeReply) error

Jump to

Keyboard shortcuts

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