mongo

package
v0.0.0-...-8232506 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver is the adapter handling communication with the MongoDB persistant store

func NewDriver

func NewDriver(conn string) (*Driver, error)

NewDriver initializes a driver for connecting to the MongoDB persistant store

func (*Driver) AddNodeToUser

func (mdb *Driver) AddNodeToUser(ctx context.Context, userID string, node models.Node) (int, error)

AddNodeToUser updates a user with data identified by id

func (*Driver) Connect

func (mdb *Driver) Connect() error

Connect attempts to connect the driver mdb to the MongoDB persistant store

func (*Driver) CreateUser

func (mdb *Driver) CreateUser(ctx context.Context, user *models.User) error

CreateUser creates a user in the MongoDB persistan storage

func (*Driver) DeleteUserByIDs

func (mdb *Driver) DeleteUserByIDs(ctx context.Context, ids []string) (int, error)

DeleteUserByIDs deletes a user from the MongoDB persistant storage based on id

func (*Driver) Disconnect

func (mdb *Driver) Disconnect() error

Disconnect attempts to disconnect the driver mdb from the MongoDB persistant store

func (*Driver) GetAllUsers

func (mdb *Driver) GetAllUsers(ctx context.Context) ([]*models.User, error)

GetAllUsers retrieves all the users from MongoDB persistant storage

func (*Driver) GetBootupState

func (mdb *Driver) GetBootupState(ctx context.Context) (models.Bootupstate, error)

GetBootupState gets the bootup state of the system

func (*Driver) GetJWTToken

func (mdb *Driver) GetJWTToken(ctx context.Context) (string, error)

GetJWTToken gets the bootup state of the system

func (*Driver) GetRootToken

func (mdb *Driver) GetRootToken(ctx context.Context) (string, error)

GetRootToken gets the bootup state of the system

func (*Driver) GetUserByEmail

func (mdb *Driver) GetUserByEmail(ctx context.Context, email string) (*models.User, error)

GetUserByEmail finds a user based on the given email

func (*Driver) GetUserByID

func (mdb *Driver) GetUserByID(ctx context.Context, id string) (*models.User, error)

GetUserByID retrieves a user from the MongoDB persistant storage based on id

func (*Driver) InitSystemConfig

func (mdb *Driver) InitSystemConfig(ctx context.Context, id string) error

InitSystemConfig initialises the persistant system config with zero values

func (*Driver) SetBootupState

func (mdb *Driver) SetBootupState(ctx context.Context, state models.Bootupstate) error

SetBootupState updates the bootup state of the system

func (*Driver) SetJWTToken

func (mdb *Driver) SetJWTToken(ctx context.Context, token string) error

SetJWTToken updates the bootup state of the system

func (*Driver) SetRootToken

func (mdb *Driver) SetRootToken(ctx context.Context, token string) error

SetRootToken updates the bootup state of the system

func (*Driver) SetUserPassword

func (mdb *Driver) SetUserPassword(ctx context.Context, id, password string) error

SetUserPassword deletes a user from the MongoDB persistant storage based on id

func (*Driver) SetUserUsername

func (mdb *Driver) SetUserUsername(ctx context.Context, id, username string) error

SetUserUsername deletes a user from the MongoDB persistant storage based on id

Jump to

Keyboard shortcuts

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