datastores

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

The list that can be iterated

Functions

func NewServiceMongodbClient

func NewServiceMongodbClient(ctx context.Context, cfg *ServiceDatastoreConfig) (mc *mongodbClient, err error)

Types

type ServiceDatastoreClient

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

func (*ServiceDatastoreClient) Add

func (sl *ServiceDatastoreClient) Add(ctx context.Context, key string, value interface{}) (err error)

func (*ServiceDatastoreClient) Delete

func (sl *ServiceDatastoreClient) Delete(ctx context.Context, key string) (err error)

func (*ServiceDatastoreClient) Find

func (sl *ServiceDatastoreClient) Find(ctx context.Context, queryParams map[string][]string) (v interface{}, err error)

func (*ServiceDatastoreClient) FindById

func (sl *ServiceDatastoreClient) FindById(ctx context.Context, key string, value interface{}) (v interface{}, err error)

func (*ServiceDatastoreClient) NewClient

func (sl *ServiceDatastoreClient) NewClient(ctx context.Context, cfg *ServiceDatastoreConfig) (err error)

func (*ServiceDatastoreClient) SetDatastoreCollection

func (sl *ServiceDatastoreClient) SetDatastoreCollection(collectionName string)

func (*ServiceDatastoreClient) Update

func (sl *ServiceDatastoreClient) Update(ctx context.Context, key string, value interface{}) (err error)

type ServiceDatastoreClientInterface

type ServiceDatastoreClientInterface interface {
	Connect(ctx context.Context, cfg *ServiceDatastoreConfig) error
	SetCollection(collection string) error
	Add(ctx context.Context, docid string, value interface{}) error
	Update(ctx context.Context, id string, value interface{}) error
	Delete(ctx context.Context, id string) error
	FindById(ctx context.Context, id string, value interface{}) (interface{}, error)
	Find(ctx context.Context, queryParams map[string][]string) (valuesArray interface{}, err error)
}

type ServiceDatastoreConfig

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

func NewServiceDatastoreConfig

func NewServiceDatastoreConfig(name ServiceDatastoreType, collection string) *ServiceDatastoreConfig

func (*ServiceDatastoreConfig) GetClient

func (*ServiceDatastoreConfig) GetDatastoreType

func (sc *ServiceDatastoreConfig) GetDatastoreType() string

func (*ServiceDatastoreConfig) GetDatastoreTypeModel

func (sl *ServiceDatastoreConfig) GetDatastoreTypeModel() ServiceDatastoreType

func (*ServiceDatastoreConfig) IsValidDatastoreType

func (sc *ServiceDatastoreConfig) IsValidDatastoreType() bool

func (*ServiceDatastoreConfig) SetConnectionString

func (sc *ServiceDatastoreConfig) SetConnectionString(s string)

func (*ServiceDatastoreConfig) SetDatabaseName

func (sc *ServiceDatastoreConfig) SetDatabaseName(s string)

func (*ServiceDatastoreConfig) SetDatastoreCollection

func (sc *ServiceDatastoreConfig) SetDatastoreCollection(s string)

func (*ServiceDatastoreConfig) SetDatastoreType

func (sc *ServiceDatastoreConfig) SetDatastoreType(s string)

func (*ServiceDatastoreConfig) SetGCPProjectID

func (sc *ServiceDatastoreConfig) SetGCPProjectID(s string)

func (*ServiceDatastoreConfig) SetGcpCredentialsFile

func (sc *ServiceDatastoreConfig) SetGcpCredentialsFile(s string)

func (*ServiceDatastoreConfig) Validate

func (sc *ServiceDatastoreConfig) Validate() (errorString string)

type ServiceDatastoreType

type ServiceDatastoreType int
const (
	SERVICEDATASTORETYPE_UNDEFINED ServiceDatastoreType = iota
	SERVICEDATASTORETYPE_FIRESTORE
	SERVICEDATASTORETYPE_COSMOSDB_MONGODB
)

func GetServiceDatastoreType

func GetServiceDatastoreType(serviceDatastoreName string) ServiceDatastoreType

func (ServiceDatastoreType) Cloud

func (ServiceDatastoreType) NewClient

func (ServiceDatastoreType) String

func (d ServiceDatastoreType) String() string

func (ServiceDatastoreType) Type

func (d ServiceDatastoreType) Type() string

Jump to

Keyboard shortcuts

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