Documentation
¶
Index ¶
- func Create(ctx context.Context, mg *db.MongoDB, res *sessionsv2.Session, expire bool) (*sessionsv2.Session, error)
- func EnsureIndex(ctx context.Context, mg *db.MongoDB) error
- func GetByAccountID(ctx context.Context, mg *db.MongoDB, id string) (*sessionsv2.Session, error)
- func GetByEmail(ctx context.Context, mg *db.MongoDB, email string) (*sessionsv2.Session, error)
- func GetByID(ctx context.Context, mg *db.MongoDB, id string) (*sessionsv2.Session, error)
- func Key(i string) func(*ListOptions)
- func List(ctx context.Context, mg *db.MongoDB, q *sessionsv2.Session) ([]*sessionsv2.Session, error)
- func Message(i string) func(*ListOptions)
- func NewListOpts() []func(*ListOptions)
- func ParseOptions(o *sessionsv2.Session) []func(*ListOptions)
- func Value(i string) func(*ListOptions)
- type ListOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, mg *db.MongoDB, res *sessionsv2.Session, expire bool) (*sessionsv2.Session, error)
Create returns a new session object on successful insert
func EnsureIndex ¶
EnsureIndex on mongodb
func GetByAccountID ¶
GetByAccountID returns a session object from sessions collection by key/value account_id if exists, otherwise an error
func GetByEmail ¶
GetByEmail returns a session object from sessions collection by key/value email if exists, otherwise an error
func GetByID ¶
GetByID returns a session object from sessions collection if exists, otherwise an error
func List ¶
func List(ctx context.Context, mg *db.MongoDB, q *sessionsv2.Session) ([]*sessionsv2.Session, error)
List session with query
func ParseOptions ¶
func ParseOptions(o *sessionsv2.Session) []func(*ListOptions)
ParseOptions parse query filters from interface
Types ¶
type ListOptions ¶
ListOptions model for account endpoint queries
func Filter ¶
func Filter(optionsList ...func(*ListOptions)) (ListOptions, bson.M)
Filter parses an option list to a bson.M query
Click to show internal directories.
Click to hide internal directories.