tectonic

package
v0.0.0-...-c0c6819 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnection     = errors.New("Connection error")
	ErrFailedWrite    = errors.New("Failed to write to server")
	ErrFailedRead     = errors.New("Failed to read from server")
	ErrFailedReadSize = errors.New("Failed to read response size")
)

Functions

This section is empty.

Types

type Delta

type Delta struct {
	Timestamp float64 `json:"ts"`
	Price     float64 `json:"price"`
	Size      float64 `json:"size"`
	Seq       uint32  `json:"seq"`
	IsTrade   bool    `json:"is_trade"`
	IsBid     bool    `json:"is_bid"`
}

Delta : Indicates a change in the orderbook state. This delta struct also works for options and other derivative products. The field `IsBid` is overloaded to equal a call option if it is true.

type TectonicClient

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

func NewTectonicClient

func NewTectonicClient(host, port string) (*TectonicClient, error)

func (*TectonicClient) BulkAdd

func (t *TectonicClient) BulkAdd(dbName string, ticks []*Delta) error

BulkAdd : Batch-add deltas stored in an array to the specified store

func (*TectonicClient) BulkInsert

func (t *TectonicClient) BulkInsert(ticks []*Delta, dbName string) error

BulkInsert : Batch-inserts deltas stored in an array into the TectonicDB server. If you want to select what data-store you want to insert the batch into, consider using the function `BulkAddInto`.

func (*TectonicClient) Clear

func (t *TectonicClient) Clear() (string, error)

Clear : Deletes everything in current store (BE CAREFUL WITH THIS METHOD)

func (*TectonicClient) ClearAll

func (t *TectonicClient) ClearAll() (string, error)

ClearAll : "Drops everything in memory"

func (*TectonicClient) Cmd

func (c *TectonicClient) Cmd(command string) (string, error)

func (*TectonicClient) Count

func (t *TectonicClient) Count() uint64

Count : "Count of items in current store"

func (*TectonicClient) CountAll

func (t *TectonicClient) CountAll() uint64

CountAll : "Returns total count from all stores"

func (*TectonicClient) Create

func (t *TectonicClient) Create(dbName string) error

Create : "Create store"

func (*TectonicClient) Exists

func (t *TectonicClient) Exists(dbName string) bool

Exists : Checks if datastore exists

func (*TectonicClient) Flush

func (t *TectonicClient) Flush() (string, error)

Flush : "Flush current store to disk"

func (*TectonicClient) FlushAll

func (t *TectonicClient) FlushAll() (string, error)

FlushAll : "Flush everything form memory to disk"

func (*TectonicClient) Get

func (t *TectonicClient) Get(amount uint64) ([]*Delta, error)

Get : "Returns `amount` items from current store"

func (*TectonicClient) GetFrom

func (t *TectonicClient) GetFrom(dbName string, amount uint64) ([]Delta, error)

GetFrom : Returns items from specified store

func (*TectonicClient) Help

func (t *TectonicClient) Help() (string, error)

Help : Return help string from Tectonic server

func (*TectonicClient) Info

func (t *TectonicClient) Info() (string, error)

Info : From official documentation: "Returns info about table schemas"

func (*TectonicClient) Insert

func (t *TectonicClient) Insert(tick *Delta) error

Insert : Inserts a single tick into the currently selected datastore

func (*TectonicClient) InsertInto

func (t *TectonicClient) InsertInto(dbName string, tick *Delta) error

InsertInto : Inserts a single tick into the datastore specified by `dbName`

func (*TectonicClient) Perf

func (t *TectonicClient) Perf() (string, error)

Perf : From official documentation: "Returns the answercount of items over time"

func (*TectonicClient) Ping

func (t *TectonicClient) Ping() (string, error)

Ping : Sends a ping message to the TectonicDB server

func (*TectonicClient) Use

func (t *TectonicClient) Use(dbName string) error

Use : "Switch the current store"

type TectonicError

type TectonicError struct {
	Message string
}

func NewTectonicError

func NewTectonicError(message string) *TectonicError

func (*TectonicError) Error

func (e *TectonicError) Error() string

Jump to

Keyboard shortcuts

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