storage

package
v0.0.0-...-d40265a Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient

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

MongoClient implements the apptokens.Repository interface

func NewMongoClient

func NewMongoClient(conn *mongo.Client) (*MongoClient, error)

func (MongoClient) GetById

func (client MongoClient) GetById(ctx context.Context, uuid string, stored interface{}) error

GetById looks up the app behind the uuid and writes the result in the passed pointer to the result. If none found returns mongo.ErrNoDocuments

func (MongoClient) GetByOrganization

func (client MongoClient) GetByOrganization(ctx context.Context, organization string, stored interface{}) error

GetAll collects all Apps which uuid is in the slice of uuids

func (MongoClient) Store

func (client MongoClient) Store(ctx context.Context, user users.User) error

InsertOne inserts one data point into the mongo database for a given db name and collection name. Query must be any of bson.* or a struct with bson tags Returned data from the coll.InsertOne are ignored and will not be returned by the function

func (MongoClient) UpdateUser

func (client MongoClient) UpdateUser(ctx context.Context, updatable users.UpdatableUser) error

Jump to

Keyboard shortcuts

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