kvclient

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: ISC Imports: 12 Imported by: 0

README

Kilovolt client

Go client for Kilovolt websocket servers, supports Kilovolt Protocol v3

Getting started

go get github.com/strimertul/kilovolt-client-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthenticated     = errors.New("not authenticated")
	ErrSubscriptionNotFound = errors.New("subscription not found")
	ErrEmptyKey             = errors.New("key empty or unset")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint string
	Logger   logrus.FieldLogger
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string, options ClientOptions) (*Client, error)

func (*Client) Close

func (s *Client) Close()

func (*Client) ConnectToWebsocket

func (s *Client) ConnectToWebsocket() error

func (*Client) GetJSON

func (s *Client) GetJSON(key string, dst interface{}) error

func (*Client) GetKey

func (s *Client) GetKey(key string) (string, error)

func (*Client) SetJSON

func (s *Client) SetJSON(key string, data interface{}) error

func (*Client) SetKey

func (s *Client) SetKey(key string, data string) error

func (*Client) Subscribe

func (s *Client) Subscribe(key string) (chan string, error)

func (*Client) Unsubscribe

func (s *Client) Unsubscribe(key string, chn chan string) error

type ClientOptions

type ClientOptions struct {
	Headers http.Header
	Logger  logrus.FieldLogger
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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