ipc

package
v0.0.0-...-e26558c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SockAddr = "/tmp/smeg.sock"

Variables

This section is empty.

Functions

func RunIpcHandler

func RunIpcHandler(server MeshIpc) error

Types

type ClientIpc

type ClientIpc interface {
	// CreateMesh: create a mesh network, return an error if the operation failed
	CreateMesh(args *NewMeshArgs, reply *string) error
	// ListMesh: list mesh network the node is a part of, return an error if the operation failed
	ListMeshes(args *ListMeshReply, reply *string) error
	// JoinMesh: join a mesh network return an error if the operation failed
	JoinMesh(args JoinMeshArgs, reply *string) error
	// LeaveMesh: leave a mesh network, return an error if the operation failed
	LeaveMesh(meshId string, reply *string) error
	// GetMesh: get the given mesh network, return an error if the operation failed
	GetMesh(meshId string, reply *GetMeshReply) error
	// Query: query the given mesh network
	Query(query QueryMesh, reply *string) error
	// PutDescription: assign a description to yourself
	PutDescription(args PutDescriptionArgs, reply *string) error
	// PutAlias: assign an alias to yourself
	PutAlias(args PutAliasArgs, reply *string) error
	// PutService: assign a service to yourself
	PutService(args PutServiceArgs, reply *string) error
	// DeleteService: retract a service
	DeleteService(args DeleteServiceArgs, reply *string) error
}

ClientIpc: Framework to invoke ipc calls to the daemon

type DeleteServiceArgs

type DeleteServiceArgs struct {
	Service string
	MeshId  string
}

DeleteServiceArgs: args to remove a service from the data store

type GetMeshReply

type GetMeshReply struct {
	Nodes []ctrlserver.MeshNode
}

GetMeshReply: ipc reply to get the mesh network

type JoinMeshArgs

type JoinMeshArgs struct {
	// MeshId is the ID of the mesh to join
	MeshId string
	// IpAddress is a routable IP in another mesh
	IpAddress string
	// WgArgs is the WireGuard parameters to use.
	WgArgs WireGuardArgs
}

type ListMeshReply

type ListMeshReply struct {
	Meshes []string
}

ListMeshReply: ipc reply of the networks the node is part of

type MeshIpc

type MeshIpc interface {
	CreateMesh(args *NewMeshArgs, reply *string) error
	ListMeshes(name string, reply *ListMeshReply) error
	JoinMesh(args *JoinMeshArgs, reply *string) error
	LeaveMesh(meshId string, reply *string) error
	GetMesh(meshId string, reply *GetMeshReply) error
	Query(query QueryMesh, reply *string) error
	PutDescription(args PutDescriptionArgs, reply *string) error
	PutAlias(args PutAliasArgs, reply *string) error
	PutService(args PutServiceArgs, reply *string) error
	DeleteService(args DeleteServiceArgs, reply *string) error
}

type NewMeshArgs

type NewMeshArgs struct {
	// WgArgs are specific WireGuard args to use
	WgArgs WireGuardArgs
}

type PutAliasArgs

type PutAliasArgs struct {
	// Alias: represents the alias of the node
	Alias string
	// MeshId: represents the meshID of the node
	MeshId string
}

PutAliasArgs: args to assign an alias to a node

type PutDescriptionArgs

type PutDescriptionArgs struct {
	// Description: descriptio to add to the network
	Description string
	// MeshID to add to the mesh network
	MeshId string
}

PutDescriptionArgs: args to assign a description to a node

type PutServiceArgs

type PutServiceArgs struct {
	Service string
	Value   string
	MeshId  string
}

PutServiceArgs: args to place a service into the data store

type QueryMesh

type QueryMesh struct {
	// MeshId: id of the mesh to query
	MeshId string
	// JMESPath: query string to query
	Query string
}

Querymesh: ipc args to query a mesh network

type SmegmeshIpc

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

func NewClientIpc

func NewClientIpc() (*SmegmeshIpc, error)

func (*SmegmeshIpc) Close

func (c *SmegmeshIpc) Close() error

func (*SmegmeshIpc) CreateMesh

func (c *SmegmeshIpc) CreateMesh(args *NewMeshArgs, reply *string) error

func (*SmegmeshIpc) DeleteService

func (c *SmegmeshIpc) DeleteService(args DeleteServiceArgs, reply *string) error

func (*SmegmeshIpc) GetMesh

func (c *SmegmeshIpc) GetMesh(meshId string, reply *GetMeshReply) error

func (*SmegmeshIpc) JoinMesh

func (c *SmegmeshIpc) JoinMesh(args JoinMeshArgs, reply *string) error

func (*SmegmeshIpc) LeaveMesh

func (c *SmegmeshIpc) LeaveMesh(meshId string, reply *string) error

func (*SmegmeshIpc) ListMeshes

func (c *SmegmeshIpc) ListMeshes(reply *ListMeshReply) error

func (*SmegmeshIpc) PutAlias

func (c *SmegmeshIpc) PutAlias(args PutAliasArgs, reply *string) error

func (*SmegmeshIpc) PutDescription

func (c *SmegmeshIpc) PutDescription(args PutDescriptionArgs, reply *string) error

func (*SmegmeshIpc) PutService

func (c *SmegmeshIpc) PutService(args PutServiceArgs, reply *string) error

func (*SmegmeshIpc) Query

func (c *SmegmeshIpc) Query(query QueryMesh, reply *string) error

type WireGuardArgs

type WireGuardArgs struct {
	// WgPort is the WireGuard port to expose
	WgPort int
	// KeepAliveWg is the number of seconds to keep alive
	// for WireGuard NAT/firewall traversal
	KeepAliveWg int
	// AdvertiseRoutes whether or not to advertise routes to and from the
	// mesh network
	AdvertiseRoutes bool
	// AdvertiseDefaultRoute whether or not to advertise the default route
	// into the mesh network
	AdvertiseDefaultRoute bool
	// Endpoint is the routable alias of the machine. Can be an IP
	// or DNS entry
	Endpoint string
	// Role is the role of the individual in the mesh
	Role string
}

WireGuardArgs are provided args specific to WireGuard

Jump to

Keyboard shortcuts

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