Documentation ¶
Index ¶
- Constants
- Variables
- func NewSelectQuery(dialect migrator.Dialect, from string) *selectQuery
- func ToAnyList[T any](input []T) []any
- type Broadcaster
- type Cache
- type ConnectFunc
- type ContinueRequest
- type ContinueToken
- type Direction
- type FieldSelectRequest
- type SQLError
- type SortBy
- type SqlEntityServer
- type StorageApiMetrics
Constants ¶
View Source
const DefaultCacheSize = 100
Variables ¶
View Source
var ( ReadCommitted = &sql.TxOptions{ Isolation: sql.LevelReadCommitted, } ReadCommittedRO = &sql.TxOptions{ Isolation: sql.LevelReadCommitted, ReadOnly: true, } )
TxOptions.
View Source
var ( ErrNotFound = errors.New("entity not found") ErrOptimisticLockingFailed = errors.New("optimistic locking failed") ErrUserNotFoundInContext = errors.New("user not found in context") ErrNextPageTokenNotSupported = errors.New("nextPageToken not yet supported") ErrLimitNotSupported = errors.New("limit not yet supported") )
Package-level errors.
Functions ¶
func NewSelectQuery ¶
Types ¶
type Broadcaster ¶
type Broadcaster[T any] interface { Subscribe(context.Context) (<-chan T, error) Unsubscribe(chan T) }
func NewBroadcaster ¶
func NewBroadcaster[T any](ctx context.Context, connect ConnectFunc[T]) (Broadcaster[T], error)
type Cache ¶
type ConnectFunc ¶
type ContinueRequest ¶
type ContinueToken ¶
type ContinueToken struct { Sort []string `json:"s"` StartOffset int64 `json:"o"` ResourceVersion int64 `json:"v"` RecordCnt int64 `json:"c"` }
func GetContinueToken ¶
func GetContinueToken(r ContinueRequest) (*ContinueToken, error)
func (*ContinueToken) String ¶
func (c *ContinueToken) String() string
type FieldSelectRequest ¶
type SQLError ¶
type SQLError struct { Err error CallType string // either Query, QueryRow or Exec TemplateName string Query string RawQuery string ScanDest []any // contains filtered or unexported fields }
SQLError is an error returned by the database, which includes additionally debugging information about what was sent to the database.
type SortBy ¶
func ParseSortBy ¶
type SqlEntityServer ¶
type SqlEntityServer interface { entity.EntityStoreServer Init() error Stop() }
func ProvideSQLEntityServer ¶
func ProvideSQLEntityServer(db db.EntityDBInterface, tracer tracing.Tracer) (SqlEntityServer, error)
type StorageApiMetrics ¶
type StorageApiMetrics struct {
OptimisticLockFailed *prometheus.CounterVec
}
var (
StorageServerMetrics *StorageApiMetrics
)
func NewStorageMetrics ¶
func NewStorageMetrics() *StorageApiMetrics
func (*StorageApiMetrics) Collect ¶
func (s *StorageApiMetrics) Collect(ch chan<- prometheus.Metric)
func (*StorageApiMetrics) Describe ¶
func (s *StorageApiMetrics) Describe(ch chan<- *prometheus.Desc)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.