sonic

package module
v0.0.0-...-96ef4af Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 11 Imported by: 0

README

Sonic-Go

Client library for the Sonic data streaming protocol. Library is WIP so do not use yet.

Installation

go get github.com/ernestrc/sonic-go

Usage

TODO

Documentation

See https://godoc.org/github.com/ernestrc/sonic-go.

License

MIT License

Documentation

Index

Constants

View Source
const (
	StreamStatusQueued   StreamStatus = 0
	StreamStatusStarted               = 1
	StreamStatusRunning               = 2
	StreamStatusWaiting               = 3
	StreamStatusFinished              = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(address string, clientOpts ...ClientOption) (client *Client)

func (*Client) Close

func (s *Client) Close() error

func (*Client) Stream

func (s *Client) Stream(ctx context.Context, req MessageRequest) (
	<-chan MessageResponse, error,
)

type ClientAck

type ClientAck struct{}

type ClientAuth

type ClientAuth struct {
	Key  string
	User string
}

type ClientCancel

type ClientCancel struct{}

type ClientOption

type ClientOption func(*Client) *Client

func WithRouteTimeout

func WithRouteTimeout(d time.Duration) ClientOption

type Message

type Message interface {
	// contains filtered or unexported methods
}

type MessageRequest

type MessageRequest interface {
	Message
	// contains filtered or unexported methods
}

type MessageResponse

type MessageResponse interface {
	Message
	// contains filtered or unexported methods
}

type Query

type Query struct {
	AuthToken string
	Query     string
	Config    map[string]interface{}
}

type Stream

type Stream interface {
	Receive(context.Context) (Message, error)
}

type StreamCompleted

type StreamCompleted struct {
	Err error
}

type StreamOutput

type StreamOutput []interface{}

func (StreamOutput) Unmarshal

func (s StreamOutput) Unmarshal(schema StreamSchema, out interface{})

func (StreamOutput) UnmarshalRaw

func (s StreamOutput) UnmarshalRaw(schema StreamSchema) map[string]interface{}

type StreamProgress

type StreamProgress struct {
	Status   StreamStatus
	Progress float64
	Total    float64
	Units    string
}

type StreamSchema

type StreamSchema []TypeHint

func (*StreamSchema) MarshalJSON

func (a *StreamSchema) MarshalJSON() ([]byte, error)

func (*StreamSchema) UnmarshalJSON

func (a *StreamSchema) UnmarshalJSON(b []byte) (err error)

type StreamStarted

type StreamStarted struct{}

type StreamStatus

type StreamStatus int

type TypeHint

type TypeHint struct {
	Name string
	Type interface{}
}

Directories

Path Synopsis
cmd
example command

Jump to

Keyboard shortcuts

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