types

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendType

type BackendType string
const (
	BackendPostgres  BackendType = "postgres"
	BackendRedis     BackendType = "redis"
	BackendMySQL     BackendType = "mysql"
	BackendSQLite    BackendType = "sqlite"
	BackendSnowflake BackendType = "snowflake"
	BackendDynamoDB  BackendType = "dynamodb"
	BackendCassandra BackendType = "cassandra"
	BackendBigQuery  BackendType = "bigquery"
	BackendRedshift  BackendType = "redshift"
	BackendTiDB      BackendType = "tidb"
	BackendTiKV      BackendType = "tikv"
)

type BigQueryOpt added in v0.0.4

type BigQueryOpt struct {
	ProjectID   string `yaml:"project_id"`
	DatasetID   string `yaml:"dataset_id"`
	Credentials string `yaml:"credentials"`
}

type CassandraOpt added in v0.0.4

type CassandraOpt struct {
	Hosts    []string      `yaml:"hosts"`
	User     string        `yaml:"user"`
	Password string        `yaml:"password"`
	KeySpace string        `yaml:"keyspace"`
	Timeout  time.Duration `yaml:"timeout"`
}

type Category added in v0.0.4

type Category = string
const (
	CategoryBatch  Category = "batch"
	CategoryStream Category = "stream"
)

type ChannelExportOpt added in v0.0.4

type ChannelExportOpt struct {
	RevisionID   int
	FeatureNames []string
	Limit        *uint64
}

type ChannelJoinOpt added in v0.0.4

type ChannelJoinOpt struct {
	FeatureFullNames []string
	EntityRows       <-chan EntityRow
	ValueNames       []string
}

type CreateEntityOpt

type CreateEntityOpt struct {
	EntityName  string
	Description string
}

type CreateFeatureOpt

type CreateFeatureOpt struct {
	FeatureName string
	GroupName   string
	ValueType   ValueType
	Description string
}

type CreateGroupOpt added in v0.0.3

type CreateGroupOpt struct {
	GroupName   string
	EntityName  string
	Category    Category
	Description string
}

type CsvFileDataSource added in v0.0.4

type CsvFileDataSource struct {
	InputFilePath string
	Delimiter     string
}

type CsvReaderDataSource added in v0.0.4

type CsvReaderDataSource struct {
	Reader    io.Reader
	Delimiter string
}

type DataSourceType added in v0.0.4

type DataSourceType int
const (
	CSV_FILE DataSourceType = iota
	CSV_READER
	TABLE_LINK
)

type DataTableFieldSchema added in v0.0.4

type DataTableFieldSchema struct {
	Name      string
	ValueType ValueType
}

type DataTableSchema added in v0.0.4

type DataTableSchema struct {
	Fields []DataTableFieldSchema
}

type DynamoDBOpt added in v0.0.4

type DynamoDBOpt struct {
	Region          string `yaml:"region"`
	EndpointURL     string `yaml:"endpoint-url"`
	AccessKeyID     string `yaml:"access-key-id"`
	SecretAccessKey string `yaml:"secret-access-key"`
	SessionToken    string `yaml:"session-token"`
	Source          string `yaml:"source"`
}

type Entity

type Entity struct {
	ID   int    `db:"id"`
	Name string `db:"name"`

	Description string    `db:"description"`
	CreateTime  time.Time `db:"create_time"`
	ModifyTime  time.Time `db:"modify_time"`
}

func (*Entity) Copy added in v0.0.2

func (e *Entity) Copy() *Entity

type EntityList added in v0.0.2

type EntityList []*Entity

func (EntityList) Copy added in v0.0.2

func (l EntityList) Copy() EntityList

func (*EntityList) Filter added in v0.0.2

func (l *EntityList) Filter(filter func(*Entity) bool) (rs EntityList)

func (*EntityList) Find added in v0.0.2

func (l *EntityList) Find(find func(*Entity) bool) *Entity

func (EntityList) Len added in v0.0.4

func (l EntityList) Len() int

type EntityRow

type EntityRow struct {
	EntityKey string
	UnixMilli int64
	Values    []string
}

type ExportOpt added in v0.0.4

type ExportOpt struct {
	RevisionID     int
	FeatureNames   []string
	Limit          *uint64
	OutputFilePath string
}

type ExportRecord added in v0.0.4

type ExportRecord []interface{}

func (ExportRecord) EntityKey added in v0.0.4

func (r ExportRecord) EntityKey() string

func (ExportRecord) ValueAt added in v0.0.4

func (r ExportRecord) ValueAt(i int) interface{}

type ExportResult added in v0.0.4

type ExportResult struct {
	Header []string
	Data   <-chan ExportRecord
	// contains filtered or unexported fields
}

func NewExportResult added in v0.0.4

func NewExportResult(header []string, data <-chan ExportRecord, error <-chan error) *ExportResult

func (*ExportResult) CheckStreamError added in v0.0.4

func (e *ExportResult) CheckStreamError() error

ATTENTION: call this method only after you consume all elements from Data channel; otherwise, it will block the Data channel.

type Feature

type Feature struct {
	ID        int       `db:"id"`
	Name      string    `db:"name"`
	FullName  string    `db:"full_name"`
	ValueType ValueType `db:"value_type"`

	Description string    `db:"description"`
	CreateTime  time.Time `db:"create_time"`
	ModifyTime  time.Time `db:"modify_time"`

	GroupID int `db:"group_id"`
	Group   *Group
}

func (*Feature) Copy added in v0.0.2

func (f *Feature) Copy() *Feature

func (*Feature) Entity added in v0.0.2

func (f *Feature) Entity() *Entity

func (*Feature) OnlineRevisionID

func (f *Feature) OnlineRevisionID() *int

type FeatureList

type FeatureList []*Feature

func (FeatureList) Copy added in v0.0.2

func (l FeatureList) Copy() FeatureList

func (FeatureList) Filter

func (l FeatureList) Filter(filter func(*Feature) bool) (rs FeatureList)

func (FeatureList) Find added in v0.0.2

func (l FeatureList) Find(find func(*Feature) bool) *Feature

func (*FeatureList) FullNames added in v0.0.4

func (l *FeatureList) FullNames() (fullNames []string)

func (FeatureList) GroupIDs added in v0.0.4

func (l FeatureList) GroupIDs() (ids []int)

func (*FeatureList) IDs added in v0.0.3

func (l *FeatureList) IDs() (ids []int)

func (*FeatureList) Len

func (l *FeatureList) Len() int

func (*FeatureList) Names

func (l *FeatureList) Names() (names []string)

type FeatureValues added in v0.0.2

type FeatureValues struct {
	EntityName       string
	EntityKey        string
	FeatureFullNames []string
	FeatureValueMap  map[string]interface{}
}

func (*FeatureValues) FeatureValueSlice added in v0.0.2

func (fv *FeatureValues) FeatureValueSlice() []interface{}

type Group added in v0.0.3

type Group struct {
	ID       int      `db:"id"`
	Name     string   `db:"name"`
	Category Category `db:"category"`

	Description string    `db:"description"`
	CreateTime  time.Time `db:"create_time"`
	ModifyTime  time.Time `db:"modify_time"`

	EntityID         int  `db:"entity_id"`
	OnlineRevisionID *int `db:"online_revision_id"`

	Entity *Entity
}

func (*Group) Copy added in v0.0.3

func (fg *Group) Copy() *Group

type GroupList added in v0.0.3

type GroupList []*Group

func (GroupList) Copy added in v0.0.3

func (l GroupList) Copy() GroupList

func (GroupList) EntityIDs added in v0.0.4

func (l GroupList) EntityIDs() []int

func (GroupList) Filter added in v0.0.3

func (l GroupList) Filter(filter func(*Group) bool) (rs GroupList)

func (GroupList) Find added in v0.0.3

func (l GroupList) Find(find func(*Group) bool) *Group

func (*GroupList) Len added in v0.0.4

func (l *GroupList) Len() int

type ImportOpt added in v0.0.3

type ImportOpt struct {
	GroupName   string
	Description string
	Revision    *int64

	DataSourceType      DataSourceType
	CsvFileDataSource   *CsvFileDataSource
	CsvReaderDataSource *CsvReaderDataSource
	TableLinkDataSource *TableLinkDataSource
}

type JoinOpt added in v0.0.3

type JoinOpt struct {
	FeatureFullNames []string
	InputFilePath    string
	OutputFilePath   string
}

type JoinResult added in v0.0.2

type JoinResult struct {
	Header []string
	Data   <-chan []interface{}
}

type ListFeatureOpt

type ListFeatureOpt struct {
	EntityName       *string
	GroupName        *string
	FeatureFullNames *[]string
}

type MetadataStoreConfig

type MetadataStoreConfig struct {
	Backend  BackendType  `yaml:"-"`
	Postgres *PostgresOpt `yaml:"postgres"`
	MySQL    *MySQLOpt    `yaml:"mysql"`
	SQLite   *SQLiteOpt   `yaml:"sqlite"`
	TiDB     *MySQLOpt    `yaml:"tidb"`
}

func (*MetadataStoreConfig) Validate added in v0.0.4

func (cfg *MetadataStoreConfig) Validate() error

type MySQLOpt added in v0.0.4

type MySQLOpt struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
}

type OfflineStoreConfig

type OfflineStoreConfig struct {
	Backend   BackendType   `yaml:"-"`
	Postgres  *PostgresOpt  `yaml:"postgres"`
	MySQL     *MySQLOpt     `yaml:"mysql"`
	Snowflake *SnowflakeOpt `yaml:"snowflake"`
	BigQuery  *BigQueryOpt  `yaml:"bigquery"`
	Redshift  *RedshiftOpt  `yaml:"redshift"`
	SQLite    *SQLiteOpt    `yaml:"sqlite"`
	TiDB      *MySQLOpt     `yaml:"tidb"`
}

func (*OfflineStoreConfig) Validate added in v0.0.4

func (cfg *OfflineStoreConfig) Validate() error

type OnlineGetOpt added in v0.0.3

type OnlineGetOpt struct {
	FeatureFullNames []string
	EntityKey        string
}

type OnlineMultiGetOpt added in v0.0.3

type OnlineMultiGetOpt struct {
	FeatureFullNames []string
	EntityKeys       []string
}

type OnlineStoreConfig

type OnlineStoreConfig struct {
	Backend   BackendType   `yaml:"-"`
	Postgres  *PostgresOpt  `yaml:"postgres"`
	Redis     *RedisOpt     `yaml:"redis"`
	MySQL     *MySQLOpt     `yaml:"mysql"`
	DynamoDB  *DynamoDBOpt  `yaml:"dynamodb"`
	Cassandra *CassandraOpt `yaml:"cassandra"`
	SQLite    *SQLiteOpt    `yaml:"sqlite"`
	TiDB      *MySQLOpt     `yaml:"tidb"`
	TiKV      *TiKVOpt      `yaml:"tikv"`
}

func (*OnlineStoreConfig) Validate added in v0.0.4

func (cfg *OnlineStoreConfig) Validate() error

type OomStoreConfig

type OomStoreConfig struct {
	MetadataStore MetadataStoreConfig `yaml:"metadata-store"`
	OfflineStore  OfflineStoreConfig  `yaml:"offline-store"`
	OnlineStore   OnlineStoreConfig   `yaml:"online-store"`
}

func (*OomStoreConfig) Validate added in v0.0.4

func (cfg *OomStoreConfig) Validate() error

type PostgresOpt

type PostgresOpt struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
}

type PushOpt added in v0.0.4

type PushOpt struct {
	EntityKey     string
	GroupName     string
	FeatureNames  []string
	FeatureValues []interface{}
}

type RedisOpt

type RedisOpt struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Password string `yaml:"password"`
	Database int    `yaml:"database"`
}

type RedshiftOpt added in v0.0.4

type RedshiftOpt = PostgresOpt

type Revision

type Revision struct {
	ID            int    `db:"id"`
	Revision      int64  `db:"revision"`
	SnapshotTable string `db:"snapshot_table"`
	CdcTable      string `db:"cdc_table"`
	Anchored      bool   `db:"anchored"`

	Description string    `db:"description"`
	CreateTime  time.Time `db:"create_time"`
	ModifyTime  time.Time `db:"modify_time"`

	GroupID int `db:"group_id"`
	Group   *Group
}

func (*Revision) Copy added in v0.0.2

func (r *Revision) Copy() *Revision

type RevisionList added in v0.0.2

type RevisionList []*Revision

func (RevisionList) Copy added in v0.0.2

func (l RevisionList) Copy() RevisionList

func (RevisionList) Filter added in v0.0.2

func (l RevisionList) Filter(filter func(*Revision) bool) (rs RevisionList)

func (RevisionList) Find added in v0.0.2

func (l RevisionList) Find(find func(*Revision) bool) *Revision

func (RevisionList) GroupIDs added in v0.0.4

func (l RevisionList) GroupIDs() []int

type SQLiteOpt added in v0.0.4

type SQLiteOpt struct {
	DBFile string `yaml:"db-file"`
}

type SnowflakeOpt added in v0.0.4

type SnowflakeOpt struct {
	Account  string `yaml:"account"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
}

type StreamRecord added in v0.0.4

type StreamRecord struct {
	GroupID   int
	EntityKey string
	UnixMilli int64
	Values    []interface{}
}

func (*StreamRecord) ToRow added in v0.0.4

func (r *StreamRecord) ToRow() []interface{}

type SyncOpt added in v0.0.2

type SyncOpt struct {
	RevisionID int
	PurgeDelay int
}

type TableLinkDataSource added in v0.0.4

type TableLinkDataSource struct {
	TableName string
}

type TiKVOpt added in v0.0.4

type TiKVOpt struct {
	PdAddrs []string `yaml:"pd-addrs"`
}

type UpdateEntityOpt

type UpdateEntityOpt struct {
	EntityName     string
	NewDescription *string
}

type UpdateFeatureOpt

type UpdateFeatureOpt struct {
	FeatureFullName string
	NewDescription  *string
}

type UpdateGroupOpt added in v0.0.3

type UpdateGroupOpt struct {
	GroupName           string
	NewDescription      *string
	NewOnlineRevisionID *int
}

type ValueType added in v0.0.4

type ValueType int
const (
	Invalid ValueType = iota
	String
	Int64
	Float64
	Bool
	Time
	Bytes
)

func ParseValueType added in v0.0.4

func ParseValueType(s string) (ValueType, error)

func (ValueType) String added in v0.0.4

func (t ValueType) String() string

func (ValueType) Validate added in v0.0.4

func (v ValueType) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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