cloudapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestTimedOut = errors.New("request timed out")
	ErrFinished        = errors.New("finished")
)

Functions

func NewCLIMessageWriterTransport

func NewCLIMessageWriterTransport(t http.RoundTripper, w io.Writer) http.RoundTripper

func NewCredentialsTransport

func NewCredentialsTransport(t http.RoundTripper, token, version string) http.RoundTripper

Types

type CLIMessageWriterTransport

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

func (CLIMessageWriterTransport) RoundTrip

type Client

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

func NewClientWithURL

func NewClientWithURL(httpClient *http.Client, host string) *Client

func (*Client) UpdateRule

func (c *Client) UpdateRule(
	ctx context.Context, input UpdateRuleInput,
) (UpdateRuleData, []UpdateRuleError, error)

type CredentialsTransport

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

func (CredentialsTransport) RoundTrip

func (t CredentialsTransport) RoundTrip(r *http.Request) (*http.Response, error)

type LogsWriter

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

func NewDeviceLogsWriter

func NewDeviceLogsWriter(
	host, token, apiVersion, hardwareID string,
	writer func(topic, message string),
) (*LogsWriter, error)

func NewRuleLogsWriter

func NewRuleLogsWriter(
	host, token, apiVersion, ruleID string,
	writer func(topic, message string),
) (*LogsWriter, error)

func (*LogsWriter) Run

func (l *LogsWriter) Run(ctx context.Context) error

type UpdateRuleData

type UpdateRuleData struct {
	Code    string
	Message string
	Title   string
}

type UpdateRuleError

type UpdateRuleError struct {
	Code    string
	Message string
	Path    []string
	Title   string
}

type UpdateRuleInput

type UpdateRuleInput struct {
	RuleID            string
	LuaCode           string
	StdlibVersion     string
	ExecutionInterval int
}

Jump to

Keyboard shortcuts

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