mir

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderRequestEnconding = "request-encoding"
	HeaderContentEncoding  = "content-encoding"
	HeaderOriginalTrigger  = "original-trigger"
	HeaderOrigin           = "origin"
	HeaderZstdEncoding     = "zstd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mir

type Mir struct {
	Bus *nats.Conn

	LockStore distributed_lock.DistributedLockStore
	// contains filtered or unexported fields
}

Expose Mir specific functions and domain Publicly expose nats io connection for custom usage

func Connect

func Connect(name string, target string) (*Mir, error)

Establish connection to the Mir server This will enable communication to and from the device To properly close the connection, call the Close() function

func (*Mir) Device

func (m *Mir) Device() *deviceRoutes

Access all device routes

func (*Mir) Disconnect

func (m *Mir) Disconnect() error

Close the connection to the Mir server Release all resources and stop all go routines

func (*Mir) Event

func (m *Mir) Event() *eventRoutes

Access all server routes

func (Mir) GetInstanceName

func (m Mir) GetInstanceName() string

func (*Mir) Server

func (m *Mir) Server() *serverRoutes

Access all server routes

type Msg

type Msg struct {
	*nats.Msg
}

func (Msg) GetOrigin

func (m Msg) GetOrigin() string

ServerId that triggered the event

func (Msg) GetOriginalTriggerId

func (m Msg) GetOriginalTriggerId() string

Mainly present for Events Represent the serverId that made the request trigger

type ProtoCmdDesc

type ProtoCmdDesc struct {
	Name    string
	Payload []byte
}

type SendDeviceCommandRequestProto

type SendDeviceCommandRequestProto struct {
	Targets       *core_apiv1.Targets
	Command       proto.Message
	DryRun        bool
	NoValidation  bool
	RefreshSchema bool
	ForcePush     bool
	TimeoutSec    uint32
}

type SendDeviceConfigRequestJson added in v0.2.0

type SendDeviceConfigRequestJson struct {
	Targets           *core_apiv1.Targets
	CommandName       string
	CommandPayload    any
	DryRun            bool
	RefreshSchema     bool
	ForcePush         bool
	SendOnlyDifferent bool
}

type SendDeviceConfigRequestProto added in v0.2.0

type SendDeviceConfigRequestProto struct {
	Targets           *core_apiv1.Targets
	Command           proto.Message
	DryRun            bool
	RefreshSchema     bool
	ForcePush         bool
	SendOnlyDifferent bool
}

Jump to

Keyboard shortcuts

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