Documentation
¶
Index ¶
- Constants
- func AreStructsEqual(struct1, struct2 interface{}) bool
- func CreateNewStructObject(inputStruct interface{}) interface{}
- func CreateStructPointerSlice(inputStruct interface{}, numElements int) interface{}
- func DeleteCollection(collection interface{}, data interface{}) ([]interface{}, error)
- func GetPropertyNameToUpperCaseMapping(obj interface{}) (map[string]string, error)
- func NewImmutableRepository(client *redis.Client, key string, expirationDuration time.Duration, ...) repository.ImmutableGenericRepositoryInterface
- func NewMutableRepository(client *redis.Client, key string, expirationDuration time.Duration, ...) repository.MutableGenericRepositoryInterface
- func NewRepository(client *redis.Client, key string, expirationDuration time.Duration, ...) repository.GenericRepositoryInterface
- func UpdateCollection(collection interface{}, data interface{}) ([]interface{}, error)
- type GenericRepository
- func (r *GenericRepository) BulkInsert(ctx context.Context, data interface{}) (interface{}, error)
- func (r *GenericRepository) BulkUpsert(ctx context.Context, data interface{}) (interface{}, error)
- func (r *GenericRepository) Delete(ctx context.Context, data interface{}) (interface{}, error)
- func (r *GenericRepository) FindAll(ctx context.Context, params map[string]interface{}, ...) (interface{}, error)
- func (r *GenericRepository) FindByID(ctx context.Context, id uuid.UUID, result interface{}) (interface{}, error)
- func (r *GenericRepository) FindOne(ctx context.Context, key string, value interface{}, result interface{}) (interface{}, error)
- func (r *GenericRepository) Insert(ctx context.Context, data interface{}) (interface{}, error)
- func (r *GenericRepository) Query(ctx context.Context, query string, params []interface{}, result interface{}) (interface{}, error)
- func (r *GenericRepository) Update(ctx context.Context, data interface{}) (interface{}, error)
- func (r *GenericRepository) Upsert(ctx context.Context, data interface{}) (interface{}, error)
- type KeyIdentifier
Constants ¶
const (
CONJUNCTION = "."
)
Variables ¶
This section is empty.
Functions ¶
func AreStructsEqual ¶
func AreStructsEqual(struct1, struct2 interface{}) bool
func CreateNewStructObject ¶
func CreateNewStructObject(inputStruct interface{}) interface{}
CreateNewStructObject takes a struct pointer as a parameter and returns a new object of the same struct type.
func CreateStructPointerSlice ¶
func CreateStructPointerSlice(inputStruct interface{}, numElements int) interface{}
CreateStructPointerSlice creates a slice of struct pointers with the same type as the input struct.
func DeleteCollection ¶
func DeleteCollection(collection interface{}, data interface{}) ([]interface{}, error)
func GetPropertyNameToUpperCaseMapping ¶
GetPropertyNameToUpperCaseMapping returns a map of property names in upper case for the given struct.
func NewImmutableRepository ¶
func NewImmutableRepository(client *redis.Client, key string, expirationDuration time.Duration, keyIdentifiers []*KeyIdentifier) repository.ImmutableGenericRepositoryInterface
func NewMutableRepository ¶
func NewMutableRepository(client *redis.Client, key string, expirationDuration time.Duration, keyIdentifiers []*KeyIdentifier) repository.MutableGenericRepositoryInterface
func NewRepository ¶
func NewRepository(client *redis.Client, key string, expirationDuration time.Duration, keyIdentifiers []*KeyIdentifier) repository.GenericRepositoryInterface
func UpdateCollection ¶
func UpdateCollection(collection interface{}, data interface{}) ([]interface{}, error)
Types ¶
type GenericRepository ¶
type GenericRepository struct {
// contains filtered or unexported fields
}
func (*GenericRepository) BulkInsert ¶
func (r *GenericRepository) BulkInsert(ctx context.Context, data interface{}) (interface{}, error)
BulkInsert for now just going to do bulkinsert for whole data
consideration - trade offs: + much faster - needs to implement sharding services for reading and writing to cutoff the data size as soon as possible
func (*GenericRepository) BulkUpsert ¶
func (r *GenericRepository) BulkUpsert(ctx context.Context, data interface{}) (interface{}, error)
BulkUpsert for now just going to do bulkupsert for whole data by removing and reinsert new data
consideration - trade offs: + much faster - needs to implement sharding services for reading and writing to cutoff the data size as soon as possible
func (*GenericRepository) Delete ¶
func (r *GenericRepository) Delete(ctx context.Context, data interface{}) (interface{}, error)
func (*GenericRepository) FindAll ¶
func (r *GenericRepository) FindAll(ctx context.Context, params map[string]interface{}, conditionalOperations []repository.ConditionalOperation, relationalOperations []repository.RelationalOperation, page int, limit int, result interface{}) (interface{}, error)
FindAll to get all the data with filtered by parameters given (Not Recommended passing the params on memcached, the process might slowed down and take more memory since it is relying on reflect)
func (*GenericRepository) FindOne ¶
func (r *GenericRepository) FindOne(ctx context.Context, key string, value interface{}, result interface{}) (interface{}, error)
func (*GenericRepository) Insert ¶
func (r *GenericRepository) Insert(ctx context.Context, data interface{}) (interface{}, error)
func (*GenericRepository) Query ¶
func (r *GenericRepository) Query(ctx context.Context, query string, params []interface{}, result interface{}) (interface{}, error)
type KeyIdentifier ¶
type KeyIdentifier struct {
// contains filtered or unexported fields
}
func NewKeyIdentifier ¶
func NewKeyIdentifier( key string, isCollection bool, propertyNameMapToKey string, ) *KeyIdentifier