types

package
v0.1.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 7 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 {
	FeatureNames []string
	UnixMilli    int64
	Limit        *uint64
}

type ChannelJoinOpt added in v0.0.4

type ChannelJoinOpt struct {
	JoinFeatureNames    []string
	ExistedFeatureNames []string
	EntityRows          <-chan EntityRow
}

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
	SnapshotInterval int
	Description      string
}

type CsvFileDataSource added in v0.0.4

type CsvFileDataSource struct {
	InputFilePath string
	Delimiter     rune
}

type CsvReaderDataSource added in v0.0.4

type CsvReaderDataSource struct {
	Reader    io.Reader
	Delimiter rune
}

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
	TimeRange DataTableTimeRange
}

type DataTableTimeRange added in v0.1.0

type DataTableTimeRange struct {
	MinUnixMilli *int64 `db:"min_unix_milli"`
	MaxUnixMilli *int64 `db:"max_unix_milli"`
}

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) IDs added in v0.1.0

func (l EntityList) IDs() (ids []int)

func (EntityList) Len added in v0.0.4

func (l EntityList) Len() int

func (EntityList) Names added in v0.1.0

func (l EntityList) Names() (names []string)

type EntityRow

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

type ExportOpt added in v0.0.4

type ExportOpt struct {
	FeatureNames   []string
	UnixMilli      int64
	Limit          *uint64
	OutputFilePath string
}

type ExportRecord added in v0.0.4

type ExportRecord struct {
	Record []interface{}
	Error  error
}

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
}

func NewExportResult added in v0.0.4

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

type Feature

type Feature struct {
	ID        int       `db:"id"`
	Name      string    `db:"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) DBFullName added in v0.1.0

func (f *Feature) DBFullName(backend BackendType) string

func (*Feature) Entity added in v0.0.2

func (f *Feature) Entity() *Entity

func (*Feature) FullName added in v0.0.4

func (f *Feature) FullName() string

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) FilterFullNames added in v0.1.0

func (l FeatureList) FilterFullNames(fullNames []string) (rs FeatureList)

func (FeatureList) Find added in v0.0.2

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

func (FeatureList) FindMissingFeatures added in v0.1.0

func (l FeatureList) FindMissingFeatures(featureNames []string) []string

func (*FeatureList) FullNames added in v0.0.4

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

func (FeatureList) GetSharedEntity added in v0.1.0

func (l FeatureList) GetSharedEntity() (*Entity, error)

func (FeatureList) GroupByGroupID added in v0.1.0

func (l FeatureList) GroupByGroupID() map[int]FeatureList

func (FeatureList) GroupByGroupName added in v0.1.0

func (l FeatureList) GroupByGroupName() map[string]FeatureList

func (FeatureList) GroupIDs added in v0.0.4

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

func (FeatureList) GroupNames added in v0.1.0

func (l FeatureList) GroupNames() []string

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
	FeatureNames    []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"`

	SnapshotInterval int `db:"snapshot_interval"`

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

	Entity *Entity
}

func (*Group) Copy added in v0.0.3

func (g *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) IDs added in v0.1.0

func (l GroupList) IDs() (ids []int)

func (GroupList) Len added in v0.0.4

func (l GroupList) Len() int

func (GroupList) Names added in v0.1.0

func (l GroupList) Names() (names []string)

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 {
	FeatureNames   []string
	InputFilePath  string
	OutputFilePath string
}

type JoinRecord added in v0.1.0

type JoinRecord struct {
	Record []interface{}
	Error  error
}

type JoinResult added in v0.0.2

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

type ListEntityOpt added in v0.1.0

type ListEntityOpt struct {
	EntityNames *[]string
}

type ListFeatureOpt

type ListFeatureOpt struct {
	EntityNames  *[]string
	GroupNames   *[]string
	FeatureNames *[]string
}

type ListGroupOpt added in v0.1.0

type ListGroupOpt struct {
	EntityNames *[]string
	GroupNames  *[]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 {
	FeatureNames []string
	GroupName    *string
	EntityKey    string
}

func (*OnlineGetOpt) Validate

func (o *OnlineGetOpt) Validate() error

type OnlineMultiGetOpt added in v0.0.3

type OnlineMultiGetOpt struct {
	FeatureNames []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"`

	PushProcessor *PushProcessorConfig `yaml:"push-processor"`
}

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

	// feature names without group prefix
	FeatureValues map[string]interface{}
}

type PushProcessorConfig added in v0.1.0

type PushProcessorConfig struct {
	BufferSize    int           `yaml:"buffer-size"`
	FlushInterval time.Duration `yaml:"flush-interval"`
}

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) Before added in v0.1.0

func (l RevisionList) Before(unixMilli int64) *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 {
	GroupName  string
	RevisionID *int
	PurgeDelay int
}

type TableLinkDataSource added in v0.0.4

type TableLinkDataSource struct {
	TableName string
}

type TableType added in v0.1.0

type TableType = string
const (
	TableBatchSnapshot  TableType = "batch_snapshot"
	TableStreamSnapshot TableType = "stream_snapshot"
	TableStreamCdc      TableType = "stream_cdc"
)

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 {
	FeatureName    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 (v 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