record

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDateLayout = "2006-01-02 15:04:05.000Z"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethods

type AuthMethods struct {
	UsernamePassword bool           `json:"usernamePassword"`
	EmailPassword    bool           `json:"emailPassword"`
	AuthProviders    []AuthProvider `json:"authProviders"`
}

type AuthProvider

type AuthProvider struct {
	Name                string `json:"name"`
	State               string `json:"state"`
	CodeVerifier        string `json:"codeVerifier"`
	CodeChallenge       string `json:"codeChallenge"`
	CodeChallengeMethod string `json:"codeChallengeMethod"`
	AuthUrl             string `json:"authUrl"`
}

type AuthResponse

type AuthResponse[T any] struct {
	Record T      `json:"record"`
	Token  string `json:"token"`
}

type Base

type Base struct {
	CollectionID   string   `json:"collectionId"`
	CollectionName string   `json:"collectionName"`
	ID             string   `json:"id"`
	Created        DateTime `json:"created"`
	Updated        DateTime `json:"updated"`
}

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() ([]byte, error)

func (DateTime) String

func (d DateTime) String() string

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(b []byte) error

type JWTToken

type JWTToken struct {
	CollectionID string `json:"collectionId"`
	Exp          int64  `json:"exp"`
	ID           string `json:"id"`
	Type         string `json:"type"`
}

type RecordQueryParams

type RecordQueryParams struct {
	url.Values
	Expand string
	Body   map[string]any
}

func (*RecordQueryParams) ToValues

func (params *RecordQueryParams) ToValues() url.Values

type Service

type Service[T any] struct {
	*crud.Service[T]
	// contains filtered or unexported fields
}

func New

func New[T any](bs *base.Service, collection string) (s *Service[T])

func (*Service[T]) AuthRefresh

func (s *Service[T]) AuthRefresh(params *RecordQueryParams) (result AuthResponse[T], err error)

func (*Service[T]) AuthWithPassword

func (s *Service[T]) AuthWithPassword(identity, password string, params *RecordQueryParams) (result AuthResponse[T], err error)

func (*Service[T]) ListAuthMethods

func (s *Service[T]) ListAuthMethods(params *url.Values) (result AuthMethods, err error)

type UserBase

type UserBase struct {
	Base
	Username        string `json:"username"`
	Email           string `json:"email"`
	EmailVisibility bool   `json:"emailVisibility"`
	Verified        bool   `json:"verified"`
}

Jump to

Keyboard shortcuts

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