Documentation
¶
Overview ¶
Package datastore implements components to fetch data from postgres or other sources.
The package contains a cache component, to fetch a value only once.
All components of the datastore are independent and can be put together.
The data flows in both directions. With the Get() method, keys can be requested. With the Update() method, values get pushed in the other direction. All components implement the two methods and thereby the flow.Flow interface.
Index ¶
- type FlowPostgres
- type FlowVoteCount
- func (s *FlowVoteCount) Connect(ctx context.Context, eventProvider func() (<-chan time.Time, func() bool), ...)
- func (s *FlowVoteCount) Get(ctx context.Context, keys ...dskey.Key) (map[dskey.Key][]byte, error)
- func (s *FlowVoteCount) Update(ctx context.Context, updateFn func(map[dskey.Key][]byte, error))
- type InvalidDataError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlowPostgres ¶
type FlowPostgres struct {
// contains filtered or unexported fields
}
FlowPostgres uses postgres to get the connections.
func NewFlowPostgres ¶
func NewFlowPostgres(lookup environment.Environmenter, updater flow.Updater) (*FlowPostgres, error)
NewFlowPostgres initializes a SourcePostgres.
TODO: This should be unexported, but there is an import cycle in the tests.
func (*FlowPostgres) HistoryInformation ¶
HistoryInformation fetches the history information for one fqid.
type FlowVoteCount ¶
type FlowVoteCount struct {
// contains filtered or unexported fields
}
FlowVoteCount is a datastore flow for the poll/vote_count value.
func NewFlowVoteCount ¶
func NewFlowVoteCount(lookup environment.Environmenter) *FlowVoteCount
NewFlowVoteCount initializes the object.
func (*FlowVoteCount) Connect ¶
func (s *FlowVoteCount) Connect(ctx context.Context, eventProvider func() (<-chan time.Time, func() bool), errHandler func(error))
Connect creates a connection to the vote service and makes sure, it stays open.
eventProvider is a function that returns a channel. If the connection fails, this function fetches such a channel and waits for a signal before it tries to open a new connection.
type InvalidDataError ¶
InvalidDataError is returned, when a key has an invalid value in the database.
func (InvalidDataError) Error ¶
func (err InvalidDataError) Error() string
Directories
¶
Path | Synopsis |
---|---|
Code generated from models.yml DO NOT EDIT.
|
Code generated from models.yml DO NOT EDIT. |
gen_fields
This tool generates the code needed for the request object.
|
This tool generates the code needed for the request object. |
Code generated with models.yml DO NOT EDIT.
|
Code generated with models.yml DO NOT EDIT. |