Versions in this module Expand all Collapse all v0 v0.32.1 Jan 21, 2025 v0.29.1 Mar 29, 2024 Changes in this version + const OptimisticLockErrorMsg + func ContextWithPartitionID(ctx context.Context, partitionID string) context.Context + func PartitionIDFromContext(ctx context.Context) string + type Criteria struct + After uint + Before uint + FieldSelector fields.Selector + IncludeDeleted bool + IncludeGC bool + LabelSelector labels.Selector + Limit int64 + Name string + Namespace *string + NoResourceVersion bool + PartitionID string + type DB interface + Get func(ctx context.Context, criteria Criteria) ([]Record, uint, error) + Insert func(ctx context.Context, rec *Record) error + Start func(ctx context.Context) error + Transaction func(ctx context.Context, do func(ctx context.Context) error) error + Watch func(ctx context.Context, criteria WatchCriteria) (chan Record, error) + type Factory struct + AutoMigrate bool + func NewFactory(schema *runtime.Scheme, dsn string, opts ...FactoryOption) (*Factory, error) + func (f *Factory) Check(req *http.Request) error + func (f *Factory) Name() string + func (f *Factory) NewDBStrategy(obj types.Object) (strategy.CompleteStrategy, error) + func (f *Factory) Scheme() *runtime.Scheme + type FactoryOption func(*Factory) + func WithEncryptionConfiguration(ctx context.Context, configPath string, apiServerId string) (FactoryOption, error) + func WithMigrationTimeout(timeout time.Duration) FactoryOption + func WithPartitionIDRequired() FactoryOption + type GormDB struct + func NewDB(tableName string, gvk schema.GroupVersionKind, db *gorm.DB, ...) *GormDB + func (g *GormDB) Get(ctx context.Context, criteria Criteria) ([]Record, uint, error) + func (g *GormDB) Insert(ctx context.Context, rec *Record) error + func (g *GormDB) Start(ctx context.Context) (err error) + func (g *GormDB) Transaction(ctx context.Context, do func(ctx context.Context) error) error + func (g *GormDB) Watch(ctx context.Context, criteria WatchCriteria) (chan Record, error) + type Record struct + APIGroup string + Create bool + Created time.Time + Data datatypes.JSON + Deleted *time.Time + Garbage bool + Generation int + ID uint + Kind string + Latest bool + Metadata datatypes.JSON + Name string + Namespace string + PartitionID string + Previous *uint + Removed *time.Time + Status datatypes.JSON + UID string + Updated time.Time + Version string + type Strategy struct + func NewStrategy(scheme *runtime.Scheme, obj runtime.Object, tableName string, db *gorm.DB, ...) (*Strategy, error) + func (s *Strategy) Create(ctx context.Context, obj types.Object) (result types.Object, err error) + func (s *Strategy) Delete(ctx context.Context, obj types.Object) (types.Object, error) + func (s *Strategy) Destroy() + func (s *Strategy) Get(ctx context.Context, namespace, name string) (types.Object, error) + func (s *Strategy) GetToList(ctx context.Context, namespace, name string) (types.ObjectList, error) + func (s *Strategy) List(ctx context.Context, namespace string, opts storage.ListOptions) (types.ObjectList, error) + func (s *Strategy) New() types.Object + func (s *Strategy) NewList() types.ObjectList + func (s *Strategy) Scheme() *runtime.Scheme + func (s *Strategy) Start(ctx context.Context) + func (s *Strategy) Update(ctx context.Context, obj types.Object) (types.Object, error) + func (s *Strategy) UpdateStatus(ctx context.Context, obj types.Object) (types.Object, error) + func (s *Strategy) Watch(ctx context.Context, namespace string, opts storage.ListOptions) (<-chan watch.Event, error) + type TableNamer interface + TableName func() string + type WatchCriteria struct + After uint + FieldSelector fields.Selector + LabelSelector labels.Selector + Name string + Namespace *string + PartitionID string