base

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPageSize is the maximum page size for paginated results
	MaxPageSize = 100
)

Variables

View Source
var (

	// InternalError is a generic error message for internal errors.
	InternalError = gqlerror.Errorf("Internal error")
)

Functions

func CountTrue

func CountTrue(ps ...bool) int

CountTrue counts the number of true values in a list of booleans.

func DecodeGlobalTokenID

func DecodeGlobalTokenID(token string) (string, int, error)

DecodeGlobalTokenID decodes a global token and returns the prefix and token id.

func EncodeGlobalTokenID

func EncodeGlobalTokenID(prefix string, id int) (string, error)

EncodeGlobalTokenID encodes a global token form and ID by prefixing it with a string and encoding it to base64.

Types

type Repository

type Repository struct {
	PDB      db.Store
	Settings config.Settings
	Log      *zerolog.Logger
}

Repository is the base repository for all repositories.

func NewRepository

func NewRepository(pdb db.Store, settings config.Settings, logger *zerolog.Logger) *Repository

NewRepository creates a new base repository.

Jump to

Keyboard shortcuts

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