common

package
v0.6.3-beta01 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Name() string
	Exec(data []byte) error
}

Command interface is used for controller commands executors

type CommandService

type CommandService interface {
	Command
	Service
}

CommandService implements both: Command + Service Is intendend for those controller commands, that must have background task running

type ErrorResponse

type ErrorResponse struct {
	MessageHeader
	Data struct {
		Type    string `json:"type"`
		Message string `json:"error"`
	} `json:"data"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MessageHeader

type MessageHeader struct {
	ID        string `json:"id"`
	MsgType   string `json:"type"`
	Timestamp string `json:"executed_at,omitempty"`
}

Generic message struct (common part for all messages)

func (*MessageHeader) Now

func (mh *MessageHeader) Now()

type Ports

type Ports struct {
	TCP []uint16 `json:"tcp"`
	UDP []uint16 `json:"udp"`
}

type SdnNetworkPath

type SdnNetworkPath struct {
	Ifname       string     // Interface, on which setup route
	PublicKey    string     // Wireguard public key
	Gateway      netip.Addr // Gateway, via which access destination
	ConnectionID int        // Unique connection ID
	GroupID      int        // Route SDN group ID
}

func (*SdnNetworkPath) String

func (sr *SdnNetworkPath) String() string

type Service

type Service interface {
	Name() string
	Run(ctx context.Context) error
}

Service interface describes background running instances

type SupportInfoHelper

type SupportInfoHelper interface {
	SupportInfo() *KeyValue
}

Jump to

Keyboard shortcuts

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