Documentation
¶
Overview ¶
Package schema has the changes which a broadcaster publishes
Index ¶
Constants ¶
const ( ChangeName = "change" ChangeShutdown = "shutdown" )
The events of a stream of a broadcaster's changes: each change, and that the server is stopping, before the stream ends, so a client knows it ended as there will be no more changes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Action ChangeAction `json:"action" help:"How it changed, which is create, update or delete" example:"create"`
Schema string `json:"schema,omitempty" help:"Schema of the table which changed" example:"llm"`
Table string `json:"table,omitempty" help:"Table which changed" example:"provider"`
Row string `json:"row,omitempty" help:"Row, or rows, which changed, such as by an identifier" example:"ollama"`
Data json.RawMessage `json:"data,omitempty" help:"What the table says of the change, such as a row's new serial"`
}
Change is how something changed, which is its action, what changed, which is a table of a schema, and which row, or rows, changed, when it says, such as by an identifier which the rows share, and what the table says of the change, such as a row's new serial, when it says anything
type ChangeAction ¶
type ChangeAction string
ChangeAction is how something changed: it was created, updated or deleted
const ( ChangeCreate ChangeAction = "create" // Created ChangeUpdate ChangeAction = "update" // Updated ChangeDelete ChangeAction = "delete" // Deleted )
func (ChangeAction) String ¶
func (a ChangeAction) String() string
func (*ChangeAction) UnmarshalJSON ¶
func (a *ChangeAction) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes an action, which must be one of the actions
func (*ChangeAction) UnmarshalText ¶
func (a *ChangeAction) UnmarshalText(data []byte) error
UnmarshalText decodes an action, such as of a flag, or a query, which must be one of the actions
type ChangeFilter ¶
type ChangeFilter struct {
Schema string `json:"schema,omitempty" name:"schema" help:"Only the changes of the schema" optional:""`
Table string `json:"table,omitempty" name:"table" help:"Only the changes of the table" optional:""`
Action ChangeAction `json:"action,omitempty" name:"action" help:"Only the changes with the action: create, update or delete" optional:""`
}
ChangeFilter matches changes: those of its schema, table and action, each of which matches any when it's empty
func (ChangeFilter) Matches ¶
func (f ChangeFilter) Matches(change Change) bool
Matches returns true when the change has the filter's schema, table and action, each of which matches any when it's empty
func (ChangeFilter) Query ¶
func (f ChangeFilter) Query() url.Values
Query returns the filter as the query of a request to watch changes
func (ChangeFilter) String ¶
func (f ChangeFilter) String() string
func (ChangeFilter) Validate ¶
func (f ChangeFilter) Validate() error
Validate returns an error when the filter's action, when it has one, isn't one of the actions