Documentation
¶
Index ¶
- Constants
- func ArrMapToStructList[T any](data []map[string]interface{}) ([]T, error)
- func JsonForLogs(obj any) string
- func MapListToStructList[T any](data []map[string]interface{}) ([]T, error)
- func MapListToStructListDynamic(source []map[string]interface{}, output interface{}) error
- func MapToStruct[T any](data map[string]interface{}) (*T, error)
- func MapToStructDynamic(source map[string]interface{}, target interface{}) (interface{}, error)
- func MarshalWithoutHTMLEscaping(v any) ([]byte, error)
- func SanitizeTimeFields(input interface{}) interface{}
- func StructToMap[T any](data T) (map[string]interface{}, error)
- func ToBytes(i any) ([]byte, error)
- func ToMap(t reflect.Type) map[string]interface{}
- func ToStructPb(obj any) (*structpb.Struct, error)
- func TrackExecutionTime(t *TimeTrack) func() *TimeTrack
- type Response
- func (r *Response) AddError(err error)
- func (r *Response) GetBegin() (*pb.BeginResponse, error)
- func (r *Response) GetCode() int64
- func (r *Response) GetCommit() (*pb.CommitTransactionResponse, error)
- func (r *Response) GetDelete() (*pb.DeleteResponse, error)
- func (r *Response) GetErrors() []string
- func (r *Response) GetHealth() (*pb.HealthResponse, error)
- func (r *Response) GetInsert() (*pb.InsertResponse, error)
- func (r *Response) GetRaw() (*pb.RawResponse, error)
- func (r *Response) GetRequestID() string
- func (r *Response) GetRollback() (*pb.RollbackResponse, error)
- func (r *Response) GetSchema() (*pb.GetSchemaResponse, error)
- func (r *Response) GetSelect() (*pb.SelectResponse, error)
- func (r *Response) GetUpdate() (*pb.UpdateResponse, error)
- func (r *Response) HasErrors() bool
- func (r *Response) Set() *pb.Response
- func (r *Response) SetBegin(begin *pb.BeginResponse) *pb.Response
- func (r *Response) SetCommit(commit *pb.CommitTransactionResponse) *pb.Response
- func (r *Response) SetDelete(delete *pb.DeleteResponse) *pb.Response
- func (r *Response) SetHealth(health *pb.HealthResponse) *pb.Response
- func (r *Response) SetInsert(insert *pb.InsertResponse) *pb.Response
- func (r *Response) SetRaw(raw *pb.RawResponse) *pb.Response
- func (r *Response) SetRollback(rollback *pb.RollbackResponse) *pb.Response
- func (r *Response) SetSchema(schema *pb.GetSchemaResponse) *pb.Response
- func (r *Response) SetSelect(selectResp *pb.SelectResponse) *pb.Response
- func (r *Response) SetUpdate(update *pb.UpdateResponse) *pb.Response
- func (r *Response) String() string
- func (r *Response) ToJSON() string
- func (r *Response) ToMap() map[string]interface{}
- type SchemaManager
- type TimeTrack
Constants ¶
View Source
const ResultKey = "result"
Variables ¶
This section is empty.
Functions ¶
func ArrMapToStructList ¶
func JsonForLogs ¶
func MapListToStructList ¶
func MapToStruct ¶
func MapToStructDynamic ¶
func SanitizeTimeFields ¶
func SanitizeTimeFields(input interface{}) interface{}
func StructToMap ¶
func TrackExecutionTime ¶
Types ¶
type Response ¶
type Response struct {
Code int64 `json:"code,omitempty"`
Errors []error `json:"errors,omitempty"`
RequestID string `json:"request_id,omitempty"`
Response *pb.Response
}
func NewInternalResponse ¶
func ToInternalResponse ¶
func (*Response) GetRequestID ¶
func (*Response) GetRollback ¶
func (r *Response) GetRollback() (*pb.RollbackResponse, error)
func (*Response) SetCommit ¶
func (r *Response) SetCommit(commit *pb.CommitTransactionResponse) *pb.Response
func (*Response) SetRollback ¶
func (r *Response) SetRollback(rollback *pb.RollbackResponse) *pb.Response
func (*Response) SetSchema ¶
func (r *Response) SetSchema(schema *pb.GetSchemaResponse) *pb.Response
type SchemaManager ¶
func NewSchemaManager ¶
func NewSchemaManager() *SchemaManager
func (*SchemaManager) MigrateSchemas ¶
func (sm *SchemaManager) MigrateSchemas(db *gorm.DB) error
func (*SchemaManager) RegisterSchema ¶
func (sm *SchemaManager) RegisterSchema(name string, schemaFunc func() any)
Click to show internal directories.
Click to hide internal directories.