Documentation
¶
Overview ¶
This package is used to interact with the corrosion API.
Index ¶
- Variables
- type Change
- type ChangeType
- type Columns
- type Config
- type CorroClient
- func (c *CorroClient) Exec(ctx context.Context, stmts []Statement) (*ExecResult, error)
- func (c *CorroClient) Query(ctx context.Context, stmt Statement) (*Rows, error)
- func (c *CorroClient) QueryRow(ctx context.Context, stmt Statement) (*Row, error)
- func (c *CorroClient) Subscribe(ctx context.Context, statement Statement, opts ...SubOpt) (*Subscription, error)
- func (c *CorroClient) UpdateSchema(ctx context.Context, stmts []string) (*ExecResult, error)
- type EOQ
- type Error
- type Event
- type EventType
- type ExecResult
- type Result
- type Row
- type Rows
- type Statement
- type SubOpt
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidChange = errors.New("corrosubs: Invalid change")
View Source
var ErrInvalidRow = errors.New("corrosubs: Invalid row")
View Source
var ErrMaxRetryExceeded = errors.New("corrosubs: lost connection")
View Source
var ErrMissedChange = errors.New("corrosubs: missed change")
View Source
var ErrNoRows = errors.New("corroclient: no rows")
View Source
var ErrScan = errors.New("corroclient: scan error")
View Source
var ErrSubscriptionClosed = errors.New("corrosubs: subscription closed")
View Source
var ErrUnknownEvent = errors.New("corroclient: unknown event in subscription")
View Source
var ErrUnrecoverableSub = errors.New("corrosubs: unrecoverable subscription")
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct { ChangeId uint64 `json:"change_id"` ChangeType ChangeType `json:"change_type"` Row *Row `json:"row"` }
type ChangeType ¶
type ChangeType string
const ( ChangeTypeInsert ChangeType = "insert" ChangeTypeUpdate ChangeType = "update" ChangeTypeDelete ChangeType = "delete" )
type CorroClient ¶
type CorroClient struct {
// contains filtered or unexported fields
}
func NewCorroClient ¶
func NewCorroClient(config Config) *CorroClient
func (*CorroClient) Exec ¶
func (c *CorroClient) Exec(ctx context.Context, stmts []Statement) (*ExecResult, error)
func (*CorroClient) Subscribe ¶ added in v0.2.0
func (c *CorroClient) Subscribe(ctx context.Context, statement Statement, opts ...SubOpt) (*Subscription, error)
func (*CorroClient) UpdateSchema ¶ added in v0.2.0
func (c *CorroClient) UpdateSchema(ctx context.Context, stmts []string) (*ExecResult, error)
type ExecResult ¶
type ExecResult struct {
Results []Result `json:"results"`
}
func (*ExecResult) Errors ¶
func (e *ExecResult) Errors() []error
type Result ¶
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
type SubOpt ¶ added in v0.2.0
type SubOpt func(*subscribeOptions)
func WithBufferSize ¶ added in v0.2.0
func WithRetryOptions ¶ added in v0.2.0
func WithSkipRows ¶ added in v0.2.0
func WithSkipRows() SubOpt
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close()
func (*Subscription) Next ¶ added in v0.2.0
func (s *Subscription) Next() (Event, error)
Click to show internal directories.
Click to hide internal directories.