Documentation ¶
Index ¶
- Variables
- func NewServiceMongodbClient(ctx context.Context, cfg *ServiceDatastoreConfig) (mc *mongodbClient, err error)
- type ServiceDatastoreClient
- func (sl *ServiceDatastoreClient) Add(ctx context.Context, key string, value interface{}) (err error)
- func (sl *ServiceDatastoreClient) Delete(ctx context.Context, key string) (err error)
- func (sl *ServiceDatastoreClient) Find(ctx context.Context, queryParams map[string][]string) (v interface{}, err error)
- func (sl *ServiceDatastoreClient) FindById(ctx context.Context, key string, value interface{}) (v interface{}, err error)
- func (sl *ServiceDatastoreClient) NewClient(ctx context.Context, cfg *ServiceDatastoreConfig) (err error)
- func (sl *ServiceDatastoreClient) SetDatastoreCollection(collectionName string)
- func (sl *ServiceDatastoreClient) Update(ctx context.Context, key string, value interface{}) (err error)
- type ServiceDatastoreClientInterface
- type ServiceDatastoreConfig
- func (sc *ServiceDatastoreConfig) GetClient() ServiceDatastoreClientInterface
- func (sc *ServiceDatastoreConfig) GetDatastoreType() string
- func (sl *ServiceDatastoreConfig) GetDatastoreTypeModel() ServiceDatastoreType
- func (sc *ServiceDatastoreConfig) IsValidDatastoreType() bool
- func (sc *ServiceDatastoreConfig) SetConnectionString(s string)
- func (sc *ServiceDatastoreConfig) SetDatabaseName(s string)
- func (sc *ServiceDatastoreConfig) SetDatastoreCollection(s string)
- func (sc *ServiceDatastoreConfig) SetDatastoreType(s string)
- func (sc *ServiceDatastoreConfig) SetGCPProjectID(s string)
- func (sc *ServiceDatastoreConfig) SetGcpCredentialsFile(s string)
- func (sc *ServiceDatastoreConfig) Validate() (errorString string)
- type ServiceDatastoreType
Constants ¶
This section is empty.
Variables ¶
View Source
var ServiceDatastoreTypeList = []ServiceDatastoreType{ SERVICEDATASTORETYPE_UNDEFINED, SERVICEDATASTORETYPE_FIRESTORE, SERVICEDATASTORETYPE_COSMOSDB_MONGODB, }
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 NewServiceDatastoreClient ¶
func NewServiceDatastoreClient(ctx context.Context, cfg *ServiceDatastoreConfig) (*ServiceDatastoreClient, error)
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) 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)
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 (sc *ServiceDatastoreConfig) GetClient() ServiceDatastoreClientInterface
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 (d ServiceDatastoreType) Cloud() clouds.CloudType
func (ServiceDatastoreType) NewClient ¶
func (d ServiceDatastoreType) NewClient() ServiceDatastoreClientInterface
func (ServiceDatastoreType) String ¶
func (d ServiceDatastoreType) String() string
func (ServiceDatastoreType) Type ¶
func (d ServiceDatastoreType) Type() string
Click to show internal directories.
Click to hide internal directories.