capyskygo

package module
v0.0.0-...-696043c Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

capyskygo

Capysky Go driver

Download
Usage

Documentation

Index

Constants

View Source
const (
	TimeLakeAccessKeyKey = "TimeLake.AccessKeyKey.85629437"
	CollTypeJson         = CollType("json")
	CollTypeCsv          = CollType("csv")
	CollTypeKv           = CollType("kv")
)

Variables

This section is empty.

Functions

func NewRPCChecker

func NewRPCChecker() grpcs.ParamChecker

NewRPCChecker used to verify function parameters between RPC client and server. Rules 'grpcs' package needs.

Types

type CapyskyClient

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

func New

func New(network, addr, accessKey string) (*CapyskyClient, error)

func (*CapyskyClient) Close

func (c *CapyskyClient) Close() error

Close connection to server.

func (*CapyskyClient) CreateCollection

func (c *CapyskyClient) CreateCollection(dbName, collName string, collType CollType, csvColumns []string) error

CreateCollection creates new collection. csvColumns: user should set a valid `csvColumns` only when `collType` is CollTypeCSV, users can append or rename csvColumns, but CAN NOT delete any column.

func (*CapyskyClient) CreateDatabase

func (c *CapyskyClient) CreateDatabase(dbName string, password string) error

CreateDatabase creates a new database.

func (*CapyskyClient) DeleteCollection

func (c *CapyskyClient) DeleteCollection(dbName, collName string) error

DeleteCollection deletes collection.

func (*CapyskyClient) DeleteDatabase

func (c *CapyskyClient) DeleteDatabase(dbName string) error

DeleteDatabase deletes database.

func (*CapyskyClient) DeleteDocs

func (c *CapyskyClient) DeleteDocs(dbName, collName string, IdGte any, IdLte any) error

DeleteDocs deletes documents by document Id range. 'IdGte' and 'IdLte' cannot be nil at the same time.

func (*CapyskyClient) DeleteObject

func (c *CapyskyClient) DeleteObject(dbName, collName, key string) error

DeleteObject deletes object from bucket.

func (*CapyskyClient) GetCollectionMaxId

func (c *CapyskyClient) GetCollectionMaxId(dbName, collName string) (any, error)

GetCollectionMaxId gets the largest document Id in specified collection.

func (*CapyskyClient) GetCollectionMinId

func (c *CapyskyClient) GetCollectionMinId(dbName, collName string) (any, error)

GetCollectionMinId gets the smallest document Id in specified collection.

func (*CapyskyClient) GetDoc

func (c *CapyskyClient) GetDoc(dbName, collName string, docId any) (*Cursor, error)

GetDoc gets document by document Id.

func (*CapyskyClient) GetDocs

func (c *CapyskyClient) GetDocs(dbName, collName string, IdGte any, IdLte any) (*Cursor, error)

GetDocs gets documents by document Id range. 'IdGte' and 'IdLte' cannot be nil at the same time.

func (*CapyskyClient) GetObject

func (c *CapyskyClient) GetObject(dbName, collName, key string) ([]byte, error)

GetObject reads object from bucket.

func (*CapyskyClient) IsCollectionExist

func (c *CapyskyClient) IsCollectionExist(dbName, collName string) (bool, error)

IsCollectionExist checks if collection exist or not.

func (*CapyskyClient) IsDatabaseExist

func (c *CapyskyClient) IsDatabaseExist(dbName string) (bool, error)

IsDatabaseExist checks if database exist or not.

func (*CapyskyClient) ListCollections

func (c *CapyskyClient) ListCollections(dbName string) ([]string, error)

ListCollections gets all collections' name in specified database.

func (*CapyskyClient) ListDatabases

func (c *CapyskyClient) ListDatabases() ([]string, error)

ListDatabases gets all database names.

func (*CapyskyClient) RenameCollection

func (c *CapyskyClient) RenameCollection(dbName, oldCollName, newCollName string) error

RenameCollection renames collection.

func (*CapyskyClient) RenameDatabase

func (c *CapyskyClient) RenameDatabase(oldDBName, newDBName string) error

RenameDatabase renames database.

func (*CapyskyClient) ResetColumns

func (c *CapyskyClient) ResetColumns(dbName, collName string, newCsvColumns []string) error

ResetColumns resets new columns.

func (*CapyskyClient) ResetDatabasePassword

func (c *CapyskyClient) ResetDatabasePassword(dbName string, oldPassword, newPassword string) error

ResetDatabasePassword resets password for database. Users can perform multiple passwords for one 'dbName'. The last password will take effect and the previous password will be used only for decrypting the old chunks.

func (*CapyskyClient) ScanObjectKeys

func (c *CapyskyClient) ScanObjectKeys(dbName, collName, pageToken string) ([]string, string, error)

ScanObjectKeys scans object keys in bucket.

func (*CapyskyClient) UpsertDocs

func (c *CapyskyClient) UpsertDocs(dbName, collName string, docs []any) error

UpsertDocs update/insert documents.

func (*CapyskyClient) UpsertObject

func (c *CapyskyClient) UpsertObject(dbName, collName, key string, value []byte) error

UpsertObject update/insert object into bucket.

type CollType

type CollType string

type Cursor

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

func (*Cursor) Decode

func (c *Cursor) Decode(valPtr any) error

func (*Cursor) Next

func (c *Cursor) Next() bool

Jump to

Keyboard shortcuts

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