control

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const GetTimeout = 5 * time.Second

Variables

View Source
var (
	ErrAgentNotConnected = errors.New("agent not connected")
)

Functions

This section is empty.

Types

type Config added in v0.0.5

type Config struct {
	MeshCentralURL         *url.URL
	MeshCentralGroupPrefix string `split_words:"true" default:"plexus"`
	MeshCentralUser        string `split_words:"true" required:"true"`
	MeshCentralPass        string `split_words:"true" required:"true"`
	MeshCentralDomain      string `split_words:"true" default:"control"`
}

func (*Config) MeshCentralAgentURL added in v0.0.5

func (c *Config) MeshCentralAgentURL() string

func (*Config) MeshCentralControlURL added in v0.0.5

func (c *Config) MeshCentralControlURL() string

func (*Config) MeshRelayURL added in v0.0.5

func (c *Config) MeshRelayURL() string

type CreatedMesh

type CreatedMesh struct {
	Name  string
	IDHex string
	ID    string
}

type Mesh

type Mesh struct {
	Name string `json:"name"`
	ID   string `json:"_id"`
}

type MeshCentral

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

func Connect

func Connect(cfg *Config, log logger.Logger) (*MeshCentral, error)

func (*MeshCentral) Close

func (m *MeshCentral) Close()

func (*MeshCentral) CloseReason added in v0.0.3

func (m *MeshCentral) CloseReason() error

func (*MeshCentral) CreateMesh

func (m *MeshCentral) CreateMesh(name string) (*CreatedMesh, error)

func (*MeshCentral) DeleteMesh

func (m *MeshCentral) DeleteMesh(id string) error

func (*MeshCentral) DeleteMeshes

func (m *MeshCentral) DeleteMeshes() error

func (*MeshCentral) Get

func (m *MeshCentral) Get(action string) (Payload, error)

func (*MeshCentral) Send

func (m *MeshCentral) Send(payload map[string]interface{}) error

func (*MeshCentral) ServerInfo added in v0.0.3

func (m *MeshCentral) ServerInfo() (*ServerInfo, error)

func (*MeshCentral) Share

func (m *MeshCentral) Share(meshID, name string, expires time.Time) (string, error)

type MeshDeviceShare

type MeshDeviceShare struct {
	URL string `json:"url"`
}

type Node

type Node struct {
	ID   string `json:"_id"`
	Name string `json:"name"`
	PWR  int    `json:"pwr"`
	Conn int    `json:"conn"`
}

type Payload

type Payload map[string]json.RawMessage

func (Payload) Action

func (p Payload) Action() string

func (Payload) Error

func (p Payload) Error() error

func (Payload) String

func (p Payload) String(name string) (string, error)

type ServerInfo added in v0.0.3

type ServerInfo struct {
	AgentHash string `json:"agentCertHash"`
	TLSHash   string `json:"tlshash"`
}

type Share

type Share struct {
	URL string
}

Jump to

Keyboard shortcuts

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