Documentation ¶
Index ¶
- Variables
- type Api
- type ColumnMap
- func (cm *ColumnMap) AddAnyColumn(key string, val interface{})
- func (cm *ColumnMap) AddBoolColumn(key string, val bool)
- func (cm *ColumnMap) AddBytesColumn(key string, val []byte)
- func (cm *ColumnMap) AddFloat64Column(key string, val float64)
- func (cm *ColumnMap) AddInt64Column(key string, val int64)
- func (cm *ColumnMap) AddStringColumn(key string, val string)
- func (cm *ColumnMap) GetInt64Column(key string) int64
- func (cm *ColumnMap) GetStringColumn(key string) string
- func (cm *ColumnMap) ToMap() map[string]interface{}
- type DefaultStore
- func (s *DefaultStore) BatchStore(id string, cols *ColumnMap) *promise.Future
- func (s *DefaultStore) Close()
- func (s *DefaultStore) Delete(id string, seq int64) error
- func (s *DefaultStore) Load(id string, seq int64) (*ColumnMap, error)
- func (s *DefaultStore) Scan(id string, param *ScanParameter) (map[int64]*ColumnMap, int64, error)
- func (s *DefaultStore) SequentialScan(id string, param *ScanParameter) ([]*SequentialMessage, int64, error)
- func (s *DefaultStore) Store(id string, cols *ColumnMap) (int64, error)
- func (s *DefaultStore) Sync() error
- func (s *DefaultStore) Update(id string, seq int64, cols *ColumnMap) error
- type Entry
- type Iterator
- type Message
- type MessageAdapter
- type MessageStore
- type ScanParameter
- type Schema
- type SequentialMessage
- type StoreOption
- type StreamMessage
- type StreamMessageAdapter
- type TmLine
- func (l *TmLine) BatchStore(message Message) (*promise.Future, error)
- func (l *TmLine) Delete(sequenceId int64) error
- func (l *TmLine) Load(sequenceId int64) (Message, error)
- func (l *TmLine) Scan(param *ScanParameter) *Iterator
- func (l *TmLine) Store(message Message) (int64, error)
- func (l *TmLine) Update(sequenceId int64, message Message) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMisuse = errors.New("misuse") ErrUnexpected = errors.New("unexpected") ErrorDone = errors.New("done") )
View Source
var ( DefaultFirstPk = "TimelineId" DefaultSecondPk = "Sequence" MinTTL = 86400 )
View Source
var DefaultStreamAdapter = &StreamMessageAdapter{
IdKey: "Id",
ContentKey: "Content",
TimestampKey: "Timestamp",
AttrPrefix: "Attr_",
}
Functions ¶
This section is empty.
Types ¶
type ColumnMap ¶
type ColumnMap struct {
// contains filtered or unexported fields
}
func LoadColumnMap ¶
func LoadColumnMap(attrs []*tablestore.AttributeColumn) *ColumnMap
func NewColumnMap ¶
func NewColumnMap() *ColumnMap
func (*ColumnMap) AddAnyColumn ¶
func (*ColumnMap) AddBoolColumn ¶
func (*ColumnMap) AddBytesColumn ¶
func (*ColumnMap) AddFloat64Column ¶
func (*ColumnMap) AddInt64Column ¶
func (*ColumnMap) AddStringColumn ¶
func (*ColumnMap) GetInt64Column ¶
func (*ColumnMap) GetStringColumn ¶
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
func (*DefaultStore) BatchStore ¶
func (s *DefaultStore) BatchStore(id string, cols *ColumnMap) *promise.Future
func (*DefaultStore) Close ¶
func (s *DefaultStore) Close()
func (*DefaultStore) Scan ¶
func (s *DefaultStore) Scan(id string, param *ScanParameter) (map[int64]*ColumnMap, int64, error)
func (*DefaultStore) SequentialScan ¶
func (s *DefaultStore) SequentialScan(id string, param *ScanParameter) ([]*SequentialMessage, int64, error)
func (*DefaultStore) Store ¶
func (s *DefaultStore) Store(id string, cols *ColumnMap) (int64, error)
func (*DefaultStore) Sync ¶
func (s *DefaultStore) Sync() error
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
type MessageAdapter ¶
type MessageStore ¶
type MessageStore interface { Sync() error Store(id string, cols *ColumnMap) (int64, error) BatchStore(id string, cols *ColumnMap) *promise.Future Update(id string, seq int64, cols *ColumnMap) error Load(id string, seq int64) (*ColumnMap, error) Delete(id string, seq int64) error // Deprecated: Use SequentialScan instead, which keeps data // sequential to support iterate from max to min and vice versa. // Scan lost all sequential detail, as it puts all sequence // number and data to map[int64]ColumnMap. Scan(id string, param *ScanParameter) (map[int64]*ColumnMap, int64, error) SequentialScan(id string, param *ScanParameter) ([]*SequentialMessage, int64, error) Close() }
func NewDefaultStore ¶
func NewDefaultStore(option StoreOption) (MessageStore, error)
func NewMessageStore ¶
func NewMessageStore(client tablestore.TableStoreApi, option StoreOption) (MessageStore, error)
type ScanParameter ¶
type ScanParameter struct { From int64 To int64 MaxCount int IsForward bool ColToGet []string Filter tablestore.ColumnFilter BufChanSize int ErrorChanSize int }
type SequentialMessage ¶
type StoreOption ¶
type StoreOption struct { Endpoint string Instance string TableName string AkId string AkSecret string SecurityToken string Schema *Schema TTL int Throughput *tablestore.ReservedThroughput TableStoreConfig *tablestore.TableStoreConfig WriterConfig *writer.Config }
type StreamMessage ¶
type StreamMessageAdapter ¶
type StreamMessageAdapter struct { IdKey string ContentKey string TimestampKey string AttrPrefix string }
type TmLine ¶
type TmLine struct {
// contains filtered or unexported fields
}
func NewTmLine ¶
func NewTmLine(id string, adapter MessageAdapter, store MessageStore) (*TmLine, error)
func (*TmLine) Scan ¶
func (l *TmLine) Scan(param *ScanParameter) *Iterator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.