mcu

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: AGPL-3.0-only Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachPluginFactoryFunc

type AttachPluginFactoryFunc func(attach *kwm.MCUTypeContainer, ws *websocket.Conn, options *Options) (Plugin, error)

type AttachedRecord

type AttachedRecord struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type AttachedResource added in v0.0.5

type AttachedResource struct {
	ID      string      `json:"id"`
	When    time.Time   `json:"when"`
	Bridge  string      `json:"bridge"`
	Plugin  string      `json:"plugin"`
	Handle  int64       `json:"handleID"`
	Summary interface{} `json:"summary,omitempty"`
	// contains filtered or unexported fields
}

func NewAttachedResource added in v0.0.5

func NewAttachedResource(record *AttachedRecord) *AttachedResource

func (*AttachedResource) BridgeHTTPHandler added in v0.0.5

func (resource *AttachedResource) BridgeHTTPHandler() http.Handler

type Client

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

func NewClient

func NewClient(c *kwm.Client, options *Options) (*Client, error)

func (*Client) Close

func (mcu *Client) Close() error

func (*Client) ID added in v0.0.5

func (mcu *Client) ID() string

func (*Client) Resource added in v0.0.5

func (mcu *Client) Resource() *ClientResource

func (*Client) Start

func (mcu *Client) Start(ctx context.Context) error

type ClientResource added in v0.0.5

type ClientResource struct {
	ID            string `json:"id"`
	URI           string `json:"uri"`
	Connected     bool   `json:"connected"`
	AttachedCount int    `json:"attachedCount"`
	// contains filtered or unexported fields
}

func (*ClientResource) Attached added in v0.0.5

func (resource *ClientResource) Attached(id string) []*AttachedResource

type Options

type Options struct {
	Config *config.Config

	Logger     logrus.FieldLogger
	HTTPClient *http.Client

	AttachPluginFactoryFunc AttachPluginFactoryFunc
}

type Plugin

type Plugin interface {
	Start(context.Context) error
	Close() error
	Bridge() string
	Summary() interface{}
}

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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