mongo

package
v0.0.0-...-4386724 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Copyright 2017 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

View Source
const (
	DbVersion     = "1.1.0"
	DbName        = "deviceadm"
	DbDevicesColl = "devices"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStoreMongo

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

func NewDataStoreMongo

func NewDataStoreMongo(config DataStoreMongoConfig) (*DataStoreMongo, error)

func NewDataStoreMongoWithSession

func NewDataStoreMongoWithSession(s *mgo.Session) *DataStoreMongo

func (*DataStoreMongo) DeleteDeviceAuth

func (db *DataStoreMongo) DeleteDeviceAuth(ctx context.Context, id model.AuthID) error

func (*DataStoreMongo) DeleteDeviceAuthByDevice

func (db *DataStoreMongo) DeleteDeviceAuthByDevice(ctx context.Context, id model.DeviceID) error

func (*DataStoreMongo) EnsureIndexes

func (db *DataStoreMongo) EnsureIndexes(ctx context.Context, s *mgo.Session) error

func (*DataStoreMongo) GetDeviceAuth

func (db *DataStoreMongo) GetDeviceAuth(ctx context.Context, id model.AuthID) (*model.DeviceAuth, error)

func (*DataStoreMongo) GetDeviceAuths

func (db *DataStoreMongo) GetDeviceAuths(ctx context.Context, skip, limit int, filter store.Filter) ([]model.DeviceAuth, error)

func (*DataStoreMongo) GetDeviceAuthsByIdentityData

func (db *DataStoreMongo) GetDeviceAuthsByIdentityData(ctx context.Context, idata string) ([]model.DeviceAuth, error)

func (*DataStoreMongo) InsertDeviceAuth

func (db *DataStoreMongo) InsertDeviceAuth(ctx context.Context, dev *model.DeviceAuth) error

func (*DataStoreMongo) Migrate

func (db *DataStoreMongo) Migrate(ctx context.Context, version string) error

func (*DataStoreMongo) MigrateTenant

func (db *DataStoreMongo) MigrateTenant(ctx context.Context, version string, tenant string) error

func (*DataStoreMongo) PutDeviceAuth

func (db *DataStoreMongo) PutDeviceAuth(ctx context.Context, dev *model.DeviceAuth) error

func (*DataStoreMongo) UpdateDeviceAuth

func (db *DataStoreMongo) UpdateDeviceAuth(ctx context.Context, dev *model.DeviceAuth) error

func (*DataStoreMongo) WithAutomigrate

func (db *DataStoreMongo) WithAutomigrate() store.DataStore

type DataStoreMongoConfig

type DataStoreMongoConfig struct {
	// MGO connection string
	ConnectionString string

	// SSL support
	SSL           bool
	SSLSkipVerify bool

	// Overwrites credentials provided in connection string if provided
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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