Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxCreator ¶
func CtxCreator(timeout int) (context.Context, context.CancelFunc)
CtxCreator Create context return context and cancelFunc
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client Used for client type
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
Disconnect Close the connection to the server
func (*Client) GetCollection ¶
func (c *Client) GetCollection(dbName string, collName string) *mongo.Collection
GetCollection Get a collection from a database
type UserCollection ¶
type UserCollection struct {
// contains filtered or unexported fields
}
UserCollection Holds a collection and other methods to manipulate it
func NewUserCollection ¶
func NewUserCollection(client *Client, dbName string, collName string, hash *goauthcrypto.HashStr) *UserCollection
NewUserCollection Creates new user service to holds the collection (table)
func (*UserCollection) CreateUser ¶
func (uc *UserCollection) CreateUser(u *goauthpkg.UserObj) error
CreateUser Insert new user to the user Collection
func (*UserCollection) GetAllUser ¶
func (uc *UserCollection) GetAllUser() (*[]string, error)
GetAllUser get all user object from mongodb
func (*UserCollection) GetByUsername ¶
func (uc *UserCollection) GetByUsername(username string) (goauthpkg.UserObj, error)
GetByUsername get user from mongodb
func (*UserCollection) Login ¶
func (uc *UserCollection) Login(c goauthpkg.Credential) (goauthpkg.UserObj, error)
Login let user log into server
Click to show internal directories.
Click to hide internal directories.