Documentation
¶
Overview ¶
package patcher provides functionality to patch resources
Index ¶
- func ProcessEvent(processName string) string
- func UserEvent(ctx context.Context) string
- func UserProcessEvent(ctx context.Context, processName string) string
- type DataChangeEvent
- type DiffElem
- type Mutation
- type PostgresPatcher
- func (p PostgresPatcher) AllColumns(databaseType any) (string, error)
- func (p PostgresPatcher) Diff(old any, patchSet *patchset.PatchSet) (map[accesstypes.Field]DiffElem, error)
- func (p PostgresPatcher) PatchSetColumns(patchSet *patchset.PatchSet, databaseType any) (string, error)
- func (p PostgresPatcher) Resolve(patchSet *patchset.PatchSet, databaseType any) (map[string]any, error)
- func (p PostgresPatcher) ViewableColumns(ctx context.Context, columnSet columnset.ColumnSet, databaseType any) (string, error)
- func (p *PostgresPatcher) WithDataChangeTableName(tableName string) *PostgresPatcher
- type RowStruct
- type SpannerPatcher
- func (p SpannerPatcher) AllColumns(databaseType any) (string, error)
- func (p *SpannerPatcher) BufferDelete(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
- func (p *SpannerPatcher) BufferDeleteWithDataChangeEvent(ctx context.Context, txn *spanner.ReadWriteTransaction, eventSource string, ...) error
- func (p *SpannerPatcher) BufferInsert(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
- func (p *SpannerPatcher) BufferInsertOrUpdate(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
- func (p *SpannerPatcher) BufferInsertOrUpdateWithDataChangeEvent(txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
- func (p *SpannerPatcher) BufferInsertWithDataChangeEvent(txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
- func (p *SpannerPatcher) BufferUpdate(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
- func (p *SpannerPatcher) BufferUpdateWithDataChangeEvent(ctx context.Context, txn *spanner.ReadWriteTransaction, eventSource string, ...) error
- func (p *SpannerPatcher) Delete(ctx context.Context, s *spanner.Client, mutation *Mutation) error
- func (p *SpannerPatcher) DeleteWithDataChangeEvent(ctx context.Context, s *spanner.Client, eventSource string, mutation *Mutation) error
- func (p SpannerPatcher) Diff(old any, patchSet *patchset.PatchSet) (map[accesstypes.Field]DiffElem, error)
- func (p *SpannerPatcher) Insert(ctx context.Context, s *spanner.Client, mutation *Mutation) error
- func (p *SpannerPatcher) InsertOrUpdate(ctx context.Context, s *spanner.Client, mutation *Mutation) error
- func (p *SpannerPatcher) InsertOrUpdateWithDataChangeEvent(ctx context.Context, s *spanner.Client, eventSource string, mutation *Mutation) error
- func (p *SpannerPatcher) InsertWithDataChangeEvent(ctx context.Context, s *spanner.Client, eventSource string, mutation *Mutation) error
- func (p SpannerPatcher) PatchSetColumns(patchSet *patchset.PatchSet, databaseType any) (string, error)
- func (p SpannerPatcher) Resolve(patchSet *patchset.PatchSet, databaseType any) (map[string]any, error)
- func (p *SpannerPatcher) Update(ctx context.Context, s *spanner.Client, mutation *Mutation) error
- func (p *SpannerPatcher) UpdateWithDataChangeEvent(ctx context.Context, s *spanner.Client, eventSource string, mutation *Mutation) error
- func (p SpannerPatcher) ViewableColumns(ctx context.Context, columnSet columnset.ColumnSet, databaseType any) (string, error)
- func (p *SpannerPatcher) WithDataChangeTableName(tableName string) *SpannerPatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessEvent ¶ added in v0.6.1
Types ¶
type DataChangeEvent ¶
type Mutation ¶ added in v0.6.0
type Mutation struct {
TableName accesstypes.Resource
RowStruct RowStruct
PatchSet *patchset.PatchSet
}
type PostgresPatcher ¶
type PostgresPatcher struct {
// contains filtered or unexported fields
}
func NewPostgresPatcher ¶
func NewPostgresPatcher() *PostgresPatcher
func (PostgresPatcher) AllColumns ¶ added in v0.3.0
AllColumns returns the database struct tags for all fields in databaseType.
func (PostgresPatcher) Diff ¶
func (p PostgresPatcher) Diff(old any, patchSet *patchset.PatchSet) (map[accesstypes.Field]DiffElem, error)
Diff returns a map of fields that have changed between old and patchSet.
func (PostgresPatcher) PatchSetColumns ¶ added in v0.0.4
func (p PostgresPatcher) PatchSetColumns(patchSet *patchset.PatchSet, databaseType any) (string, error)
PatchSetColumns returns the database struct tags for the field in databaseType if it exists in patchSet.
func (PostgresPatcher) Resolve ¶
func (p PostgresPatcher) Resolve(patchSet *patchset.PatchSet, databaseType any) (map[string]any, error)
Resolve returns a map with the keys set to the database struct tags found on databaseType, and the values set to the values in patchSet.
func (PostgresPatcher) ViewableColumns ¶ added in v0.0.4
func (p PostgresPatcher) ViewableColumns(ctx context.Context, columnSet columnset.ColumnSet, databaseType any) (string, error)
ViewableColumns returns the database struct tags for the fields in databaseType that the user has access to view.
func (*PostgresPatcher) WithDataChangeTableName ¶
func (p *PostgresPatcher) WithDataChangeTableName(tableName string) *PostgresPatcher
type RowStruct ¶
func NewRowStruct ¶
type SpannerPatcher ¶
type SpannerPatcher struct {
// contains filtered or unexported fields
}
func NewSpannerPatcher ¶
func NewSpannerPatcher() *SpannerPatcher
func (SpannerPatcher) AllColumns ¶ added in v0.3.0
AllColumns returns the database struct tags for all fields in databaseType.
func (*SpannerPatcher) BufferDelete ¶ added in v0.5.0
func (p *SpannerPatcher) BufferDelete(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
func (*SpannerPatcher) BufferDeleteWithDataChangeEvent ¶ added in v0.5.0
func (p *SpannerPatcher) BufferDeleteWithDataChangeEvent(ctx context.Context, txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
func (*SpannerPatcher) BufferInsert ¶ added in v0.5.0
func (p *SpannerPatcher) BufferInsert(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
func (*SpannerPatcher) BufferInsertOrUpdate ¶ added in v0.5.0
func (p *SpannerPatcher) BufferInsertOrUpdate(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
func (*SpannerPatcher) BufferInsertOrUpdateWithDataChangeEvent ¶ added in v0.5.0
func (p *SpannerPatcher) BufferInsertOrUpdateWithDataChangeEvent(txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
func (*SpannerPatcher) BufferInsertWithDataChangeEvent ¶ added in v0.5.0
func (p *SpannerPatcher) BufferInsertWithDataChangeEvent(txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
func (*SpannerPatcher) BufferUpdate ¶ added in v0.5.0
func (p *SpannerPatcher) BufferUpdate(txn *spanner.ReadWriteTransaction, mutation *Mutation) error
func (*SpannerPatcher) BufferUpdateWithDataChangeEvent ¶ added in v0.5.0
func (p *SpannerPatcher) BufferUpdateWithDataChangeEvent(ctx context.Context, txn *spanner.ReadWriteTransaction, eventSource string, mutation *Mutation) error
func (*SpannerPatcher) DeleteWithDataChangeEvent ¶
func (SpannerPatcher) Diff ¶
func (p SpannerPatcher) Diff(old any, patchSet *patchset.PatchSet) (map[accesstypes.Field]DiffElem, error)
Diff returns a map of fields that have changed between old and patchSet.
func (*SpannerPatcher) InsertOrUpdate ¶ added in v0.5.0
func (*SpannerPatcher) InsertOrUpdateWithDataChangeEvent ¶ added in v0.5.0
func (*SpannerPatcher) InsertWithDataChangeEvent ¶
func (SpannerPatcher) PatchSetColumns ¶ added in v0.0.4
func (p SpannerPatcher) PatchSetColumns(patchSet *patchset.PatchSet, databaseType any) (string, error)
PatchSetColumns returns the database struct tags for the field in databaseType if it exists in patchSet.
func (SpannerPatcher) Resolve ¶
func (p SpannerPatcher) Resolve(patchSet *patchset.PatchSet, databaseType any) (map[string]any, error)
Resolve returns a map with the keys set to the database struct tags found on databaseType, and the values set to the values in patchSet.
func (*SpannerPatcher) UpdateWithDataChangeEvent ¶
func (SpannerPatcher) ViewableColumns ¶ added in v0.0.4
func (p SpannerPatcher) ViewableColumns(ctx context.Context, columnSet columnset.ColumnSet, databaseType any) (string, error)
ViewableColumns returns the database struct tags for the fields in databaseType that the user has access to view.
func (*SpannerPatcher) WithDataChangeTableName ¶
func (p *SpannerPatcher) WithDataChangeTableName(tableName string) *SpannerPatcher