mongodb

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host         string `envconfig:"LINKED_STORE_MONGO_HOST" default:"localhost:27017"`
	DatabaseName string `envconfig:"LINKED_STORE_MONGO_DATABASE" default:"cloud2cloudConnector"`
	// contains filtered or unexported fields
}

type Option

type Option func(Config) Config

Option provides the means to use function call chaining

func WithTLS

func WithTLS(cfg *tls.Config) Option

WithTLS configures connection to use TLS

type Store

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

Store implements an Store for MongoDB.

func NewStore

func NewStore(ctx context.Context, cfg Config, opts ...Option) (*Store, error)

NewStore creates a new Store.

func NewStoreWithSession

func NewStoreWithSession(ctx context.Context, client *mongo.Client, dbPrefix string) (*Store, error)

NewStoreWithSession creates a new Store with a session.

func (*Store) Clear

func (s *Store) Clear(ctx context.Context) error

Clear clears the event storage.

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Close closes the database session.

func (*Store) DBName

func (s *Store) DBName() string

DBName returns db name

func (*Store) InsertLinkedAccount

func (s *Store) InsertLinkedAccount(ctx context.Context, sub store.LinkedAccount) error

func (*Store) InsertLinkedCloud

func (s *Store) InsertLinkedCloud(ctx context.Context, sub store.LinkedCloud) error

func (*Store) LoadLinkedAccounts

func (s *Store) LoadLinkedAccounts(ctx context.Context, query store.Query, h store.LinkedAccountHandler) error

func (*Store) LoadLinkedClouds

func (s *Store) LoadLinkedClouds(ctx context.Context, query store.Query, h store.LinkedCloudHandler) error

func (*Store) RemoveLinkedAccount

func (s *Store) RemoveLinkedAccount(ctx context.Context, linkedAccountId string) error

func (*Store) RemoveLinkedCloud

func (s *Store) RemoveLinkedCloud(ctx context.Context, linkedCloudId string) error

func (*Store) UpdateLinkedAccount

func (s *Store) UpdateLinkedAccount(ctx context.Context, sub store.LinkedAccount) error

func (*Store) UpdateLinkedCloud

func (s *Store) UpdateLinkedCloud(ctx context.Context, sub store.LinkedCloud) error

Jump to

Keyboard shortcuts

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