Documentation
¶
Index ¶
- Constants
- Variables
- func Deserialize[E any](data []byte, serializer Serializer) (E, error)
- func Serialize(data interface{}, serializer Serializer) ([]byte, error)
- func SerializerExtension(serializer Serializer) string
- type Factory
- type GenericDAO
- type OrganizationDAO
- type PageQuery
- type PageResult
- type Pager
- type PagerProcFunc
- type RegistrationDAO
- type RoleDAO
- type Serializer
- type UserDAO
- type WebAuthnDAO
Constants ¶
View Source
const ( CONSISTENCY_LOCAL int = iota CONSISTENCY_QUORUM )
View Source
const ( SORT_ASCENDING = iota SORT_DESCENDING )
View Source
const (
QUERY_TYPE_COUNT = iota
)
Variables ¶
View Source
var (
ErrInvalidSerializer = errors.New("serializer: invalid serializer type")
)
View Source
var (
ErrRecordNotFound = errors.New("datastore: record not found")
)
Functions ¶
func Deserialize ¶
func Deserialize[E any](data []byte, serializer Serializer) (E, error)
Deserializes the provided data using the specified serializer
func Serialize ¶
func Serialize(data interface{}, serializer Serializer) ([]byte, error)
Serializes the provided data using the specified serializer
func SerializerExtension ¶
func SerializerExtension(serializer Serializer) string
Returns the file extension for the provided serializer
Types ¶
type Factory ¶
type Factory interface { OrganizationDAO() (OrganizationDAO, error) UserDAO() (UserDAO, error) RegistrationDAO() (RegistrationDAO, error) RoleDAO() (RoleDAO, error) WebAuthnDAO() (WebAuthnDAO, error) }
type GenericDAO ¶
type OrganizationDAO ¶
type OrganizationDAO interface { GetUsers(id uint64, CONSISTENCY_LEVEL int) ([]*entities.User, error) GenericDAO[*entities.Organization] }
type PageQuery ¶
PageQuery represents a datastore query for a single page of records
func NewPageQuery ¶
func NewPageQuery() PageQuery
type PageResult ¶
type PageResult[E any] struct { Entities []E `yaml:"entities" json:"entities"` Page int `yaml:"page" json:"page"` PageSize int `yaml:"size" json:"size"` HasMore bool `yaml:"has_more" json:"has_more"` }
PageResult represents a datastore page query resultset
func NewPageResult ¶
func NewPageResult[E any]() PageResult[E]
func NewPageResultFromQuery ¶
func NewPageResultFromQuery[E any](q PageQuery) PageResult[E]
type Pager ¶
type Pager[E any] interface { Page(pageQuery PageQuery, CONSISTENCY_LEVEL int) (PageResult[E], error) ForEachPage(pageQuery PageQuery, pagerProcFunc PagerProcFunc[E], CONSISTENCY_LEVEL int) error }
type PagerProcFunc ¶
type RegistrationDAO ¶
type RegistrationDAO interface { GenericDAO[*entities.Registration] }
type UserDAO ¶
type UserDAO interface { GenericDAO[*entities.User] }
type WebAuthnDAO ¶
type WebAuthnDAO interface { GenericDAO[*entities.Blob] }
Click to show internal directories.
Click to hide internal directories.