schema

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeySpace     = "spot_prod"
	DefaultBaseLogTable = "spot_prod.base_log"

	BaseLogCreateTable = `` /* 829-byte string literal not displayed */

	BaseLogAlterTableGCGraceSeconds = `ALTER TABLE %s.base_log WITH gc_grace_seconds = %d;`
	BaseLogCreateIndex              = `CREATE INDEX IF NOT EXISTS idx_request_id ON %s.base_log (request_id);`

	LogMetaCreateTable = `` /* 686-byte string literal not displayed */

	LogMetaCreateIndex = `CREATE INDEX IF NOT EXISTS idx_tags_entry ON %s.base_log_meta (ENTRIES(tags));`
)

Variables

This section is empty.

Functions

func BaseLogWithOrgName

func BaseLogWithOrgName(orgName string) string

BaseLogWithOrgName .

func KeyspaceWithOrgName

func KeyspaceWithOrgName(orgName string) string

KeyspaceWithOrgName orgName must match ^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ refer https://stackoverflow.com/questions/29569443/cassandra-keyspace-name-with-hyphen

Types

type CassandraSchema

type CassandraSchema struct {
	Logger logs.Logger
	// contains filtered or unexported fields
}

func NewCassandraSchema

func NewCassandraSchema(cass cassandra.Interface, l logs.Logger, ops ...Option) (*CassandraSchema, error)

func (*CassandraSchema) CreateDefault

func (cs *CassandraSchema) CreateDefault() error

func (*CassandraSchema) RunDaemon

func (cs *CassandraSchema) RunDaemon(ctx context.Context, interval time.Duration, mutex mutex.Interface)

func (*CassandraSchema) ValidateOrg

func (cs *CassandraSchema) ValidateOrg(orgName string) bool

type LogSchema

type LogSchema interface {
	RunDaemon(ctx context.Context, interval time.Duration, mutex mutex.Interface)
	CreateDefault() error
	ValidateOrg(orgName string) bool
}

type Option

type Option func(cs *CassandraSchema)

func WithMutexKey

func WithMutexKey(key string) Option

Jump to

Keyboard shortcuts

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