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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
kvcli command

Jump to

Keyboard shortcuts

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