baseconf

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2024 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncrementalDbEntry

type IncrementalDbEntry struct {
	ChangedAt types.UnixMilli `db:"changed_at"`
	Deleted   types.Bool      `db:"deleted"`
}

IncrementalDbEntry contains the changed_at and deleted columns as struct fields.

This type partially implements config.IncrementalConfigurable with GetChangedAt and IsDeleted. Thus, it can be embedded in other types with the _`db:",inline"`_ struct tag. However, most structs might want to embed the IncrementalPkDbEntry struct instead.

func (IncrementalDbEntry) GetChangedAt

func (i IncrementalDbEntry) GetChangedAt() types.UnixMilli

GetChangedAt returns the changed_at value of this entry from the database.

It is required by the config.IncrementalConfigurable interface.

func (IncrementalDbEntry) IsDeleted

func (i IncrementalDbEntry) IsDeleted() bool

IsDeleted indicates if this entry is marked as deleted in the database.

It is required by the config.IncrementalConfigurable interface.

type IncrementalPkDbEntry

type IncrementalPkDbEntry[PK comparable] struct {
	IncrementalDbEntry `db:",inline"`
	ID                 PK `db:"id"`
}

IncrementalPkDbEntry implements a single primary key named id of a generic type next to IncrementalDbEntry.

This type embeds IncrementalDbEntry and adds a single column/value id field, getting one step closer to implementing the config.IncrementalConfigurable interface. Thus, it needs to be embedded with the _`db:",inline"`_ struct tag.

func (IncrementalPkDbEntry[PK]) GetPrimaryKey

func (i IncrementalPkDbEntry[PK]) GetPrimaryKey() PK

GetPrimaryKey returns the id of this entry from the database.

It is required by the config.IncrementalConfigurable interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL