mongodb

package
v0.0.0-...-cc2a774 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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:"openapiConnector"`
	// 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) FindOrCreateSubscription

func (s *Store) FindOrCreateSubscription(ctx context.Context, sub store.Subscription) (store.Subscription, error)

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) LoadSubscriptions

func (s *Store) LoadSubscriptions(ctx context.Context, queries []store.SubscriptionQuery, h store.SubscriptionHandler) 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) RemoveSubscriptions

func (s *Store) RemoveSubscriptions(ctx context.Context, query store.SubscriptionQuery) 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