schema

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 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

func KeyspaceWithOrgName

func KeyspaceWithOrgName(orgName string) string

Keyspace的要求(https://stackoverflow.com/questions/29569443/cassandra-keyspace-name-with-hyphen) orgName 可能会不符合。其规则:^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ 存在以数字为开头, 或者包含- ,以及大写的情况。需要特殊处理

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) Name

func (cs *CassandraSchema) Name() string

func (*CassandraSchema) RunDaemon

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

func (*CassandraSchema) ValidateOrg added in v1.3.0

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

type LogSchema

type LogSchema interface {
	Name() string
	RunDaemon(ctx context.Context, interval time.Duration, muInf 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