Documentation
¶
Index ¶
- Variables
- func ConvertToArrayInterface(arrayPointerStruct interface{}) []interface{}
- func GetPropertyNameTolowerCaseMapping(obj interface{}) (map[string]string, error)
- func GetPropertyNamesAndValues(data interface{}) ([]string, []interface{}, error)
- func MigrateTable(session *gocql.Session, keySpace string, entity interface{}) error
- func NewMutableRepository(db *gocql.Session, keySpace string) repository.MutableGenericRepositoryInterface
- func NewRepository(db *gocql.Session, keySpace string) repository.GenericRepositoryInterface
- func StructToMap(obj interface{}) (map[string]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)
Constants ¶
This section is empty.
Variables ¶
var (
GoTypeMapToCQLType map[string]string = map[string]string{
"Time": "TIMESTAMP",
"UUID": "UUID",
"string": "TEXT",
"int": "INT",
"int32": "INT",
"int64": "BIGINT",
"float32": "FLOAT",
"float64": "FLOAT",
"bool": "BOOLEAN",
"[]byte": "BLOB",
}
)
Functions ¶
func ConvertToArrayInterface ¶
func ConvertToArrayInterface(arrayPointerStruct interface{}) []interface{}
func GetPropertyNameTolowerCaseMapping ¶
GetPropertyNameToUpperCaseMapping returns a map of property names in upper case for the given struct.
func MigrateTable ¶
func NewMutableRepository ¶
func NewMutableRepository(db *gocql.Session, keySpace string) repository.MutableGenericRepositoryInterface
DO NOT USE Pointer for nosql (Cassandra) object due to migration issue, please use cast library to casting object do not rely on result due type mismatch, deleted process need to be adjusted later, for now it would be hard delete
func NewRepository ¶
func NewRepository(db *gocql.Session, keySpace string) repository.GenericRepositoryInterface
DO NOT USE Pointer for nosql (Cassandra) object due to migration issue, please use cast library to casting object do not rely on result due type mismatch, deleted process need to be adjusted later, for now it would be hard delete
func StructToMap ¶
StructToMap converts a pointer to a struct into a map[string]interface{}
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)
func (*GenericRepository) BulkUpsert ¶
func (r *GenericRepository) BulkUpsert(ctx context.Context, data interface{}) (interface{}, error)
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 for IN params please pass the object directly without parsing to string
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)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
We create this empty file as the workaround for this bug: https://github.com/golang/go/issues/27333
|
We create this empty file as the workaround for this bug: https://github.com/golang/go/issues/27333 |