Documentation
¶
Overview ¶
Package fakethread is a provider of chat threads for tests: a unit codec and a rows provider whose rows carry no payload. Nothing registers it.
Index ¶
- Constants
- Variables
- func Row(t Thread) api.Row
- type Payload
- type Payloads
- type Provider
- func (p *Provider) Derive(_ readmodel.Base, in any, _ time.Time) (api.Row, error)
- func (p *Provider) Facets() []api.FacetSpec
- func (p *Provider) Listed(context.Context) ([]unit.Unit, error)
- func (p *Provider) Load(_ context.Context, units []unit.Unit) (map[unit.Unit]any, error)
- func (p *Provider) Provider() unit.ProviderID
- func (p *Provider) Set(t Thread)
- func (p *Provider) Situations() []api.SituationSpec
- func (p *Provider) Views() []api.ViewSpec
- type Thread
Constants ¶
const ( KindWaiting api.Kind = "waiting" KindAnswered api.Kind = "answered" )
The kinds of a thread.
const FacetChannel = "channel"
FacetChannel is the thread provider's own facet.
const ID unit.ProviderID = "thread"
Variables ¶
var Codec = unit.OpaqueCodec{ID: ID}
Codec accepts any non-blank one-line key.
Functions ¶
Types ¶
type Payloads ¶
type Payloads struct{}
Payloads reads a fake thread's turn payload from its unit alone.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider serves a row per thread it holds.
func (*Provider) Provider ¶
func (p *Provider) Provider() unit.ProviderID
func (*Provider) Situations ¶
func (p *Provider) Situations() []api.SituationSpec