xstorage

package
v0.0.0-...-a136232 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CTXKEY_CFG ctxkey = "ackstream.xstorage.configs"
View Source
const CTXKEY_CONN ctxkey = "ackstream.xstorage.connection"

Variables

View Source
var ErrCfgNotFound = errors.New("no configs was set")
View Source
var ErrConnNotFound = errors.New("no connection was initialized")
View Source
var ErrEventInvalid = errors.New("event is not valid")
View Source
var ErrEventQueryInvalid = errors.New("event query is not valid")

Functions

func CfgWithContext

func CfgWithContext(ctx context.Context, cfg *Configs) context.Context

func ConnFromContext

func ConnFromContext(ctx context.Context) (*gocql.Session, error)

func ConnWithContext

func ConnWithContext(ctx context.Context, conn *gocql.Session) context.Context

func Migrate

func Migrate(ctx context.Context, dirs []string) error

func NewConnection

func NewConnection(ctx context.Context) (*gocql.Session, error)

Types

type Configs

type Configs struct {
	Hosts    []string `json:"hosts" mapstructure:"ACKSTREAM_XSTORAGE_HOSTS"`
	Keyspace string   `json:"keyspace" mapstructure:"ACKSTREAM_XSTORAGE_KEYSPACE"`
	Table    string   `json:"table" mapstructure:"ACKSTREAM_XSTORAGE_TABLE"`
}

func CfgFromContext

func CfgFromContext(ctx context.Context) (*Configs, error)

type Get

type Get func(sample *entities.Event) (*entities.Event, error)

func NewGet

func NewGet(ctx context.Context) (Get, error)

type Put

type Put func(event *entities.Event) error

func NewPut

func NewPut(ctx context.Context) (Put, error)

Jump to

Keyboard shortcuts

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