Documentation
¶
Index ¶
- Variables
- func DatabaseConnection() error
- func LoadConfig()
- func LoadRoute()
- func New()
- func NoSqlConnection()
- func Run()
- func Start()
- type Configuration
- func (configuration *Configuration) AddConfig(name string, userConfig interface{}) *Configuration
- func (configuration *Configuration) AddNoSqlConfig(name string, userConfig interface{}) *Configuration
- func (configuration *Configuration) AddRelationDBConfig(name string, userConfig interface{}) *Configuration
- func (configuration Configuration) Bool(key string) (bool, bool)
- func (configuration Configuration) Byte(key string) (byte, bool)
- func (configuration Configuration) Bytes(key string) ([]byte, bool)
- func (configuration Configuration) Complex128(key string) (complex128, bool)
- func (configuration Configuration) Complex64(key string) (complex64, bool)
- func (configuration Configuration) Float32(key string) (float32, bool)
- func (configuration Configuration) Float64(key string) (float64, bool)
- func (configuration Configuration) Get(key string) (interface{}, bool)
- func (configuration Configuration) GetGetter(key string) (*structil.Getter, bool)
- func (configuration Configuration) GetString(key string) string
- func (configuration Configuration) GetType(key string) (reflect.Type, bool)
- func (configuration Configuration) GetValue(key string) (reflect.Value, bool)
- func (configuration Configuration) Getter(key string) *Getter
- func (configuration Configuration) Has(key string) bool
- func (configuration Configuration) Int(key string) (int, bool)
- func (configuration Configuration) Int16(key string) (int16, bool)
- func (configuration Configuration) Int32(key string) (int32, bool)
- func (configuration Configuration) Int64(key string) (int64, bool)
- func (configuration Configuration) Int8(key string) (int8, bool)
- func (configuration Configuration) IsArray(key string) bool
- func (configuration Configuration) IsBool(key string) bool
- func (configuration Configuration) IsByte(key string) bool
- func (configuration Configuration) IsBytes(key string) bool
- func (configuration Configuration) IsChan(key string) bool
- func (configuration Configuration) IsComplex128(key string) bool
- func (configuration Configuration) IsComplex64(key string) bool
- func (configuration Configuration) IsFloat32(key string) bool
- func (configuration Configuration) IsFloat64(key string) bool
- func (configuration Configuration) IsFunc(key string) bool
- func (configuration Configuration) IsInt(key string) bool
- func (configuration Configuration) IsInt16(key string) bool
- func (configuration Configuration) IsInt32(key string) bool
- func (configuration Configuration) IsInt64(key string) bool
- func (configuration Configuration) IsInt8(key string) bool
- func (configuration Configuration) IsMap(key string) bool
- func (configuration Configuration) IsSlice(key string) bool
- func (configuration Configuration) IsString(key string) bool
- func (configuration Configuration) IsStruct(key string) bool
- func (configuration Configuration) IsUint(key string) bool
- func (configuration Configuration) IsUint16(key string) bool
- func (configuration Configuration) IsUint32(key string) bool
- func (configuration Configuration) IsUint64(key string) bool
- func (configuration Configuration) IsUint8(key string) bool
- func (configuration Configuration) IsUintptr(key string) bool
- func (configuration Configuration) IsUnsafePointer(key string) bool
- func (configuration *Configuration) Load() map[string]interface{}
- func (configuration Configuration) Names(key string) []string
- func (configuration Configuration) NumField(key string) int
- func (configuration Configuration) Slice(key string) ([]interface{}, bool)
- func (configuration *Configuration) String(key string) (string, bool)
- func (configuration Configuration) ToMap(key string) map[string]interface{}
- func (configuration Configuration) Uint(key string) (uint, bool)
- func (configuration Configuration) Uint16(key string) (uint16, bool)
- func (configuration Configuration) Uint32(key string) (uint32, bool)
- func (configuration Configuration) Uint64(key string) (uint64, bool)
- func (configuration Configuration) Uint8(key string) (uint8, bool)
- func (configuration Configuration) Uintptr(key string) (uintptr, bool)
- func (configuration Configuration) UnsafePointer(key string) (unsafe.Pointer, bool)
- type Database
- type Getter
- type LoggerBuilder
- type Model
- type MongoCollection
- func (collection MongoCollection) Find(filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error, context.Context)
- func (collection MongoCollection) FindOne(filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
- func (collection MongoCollection) FindOneAndDelete(filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult
- func (collection MongoCollection) FindOneAndUpdate(filter interface{}, update interface{}, ...) *mongo.SingleResult
- func (collection MongoCollection) InsertOne(document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- func (mongoCollection MongoCollection) WithContext() MongoCollection
- type MongoDB
- type PaginationMeta
- type Paginator
- type Response
- type ResponseBuilder
- func (response ResponseBuilder) Abort(c *gin.Context)
- func (response ResponseBuilder) AbortWithError(c *gin.Context, err error)
- func (response ResponseBuilder) AbortWithStatusJSON(c *gin.Context)
- func (response ResponseBuilder) AsciiJSON(c *gin.Context)
- func (response ResponseBuilder) Build() interface{}
- func (response ResponseBuilder) Code(status int) ResponseBuilder
- func (response ResponseBuilder) Data(data interface{}) ResponseBuilder
- func (response ResponseBuilder) Html(c *gin.Context, name string)
- func (response ResponseBuilder) IndentedJSON(c *gin.Context)
- func (response ResponseBuilder) Json(c *gin.Context)
- func (response ResponseBuilder) JsonP(c *gin.Context)
- func (response ResponseBuilder) Message(message string) ResponseBuilder
- func (response ResponseBuilder) ProtoBuf(c *gin.Context)
- func (response ResponseBuilder) PureJSON(c *gin.Context)
- func (response ResponseBuilder) Raw(raw map[string]interface{}) ResponseBuilder
- func (response ResponseBuilder) Redirect(c *gin.Context, location string)
- func (response *ResponseBuilder) SetCodeKeyName(name string) *ResponseBuilder
- func (response *ResponseBuilder) SetDataKeyName(name string) *ResponseBuilder
- func (response *ResponseBuilder) SetMessageKeyName(name string) *ResponseBuilder
- func (response ResponseBuilder) Xml(c *gin.Context)
- func (response ResponseBuilder) Yaml(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
var Pagination paginator.Paginator
var Router *gin.Engine
Functions ¶
func DatabaseConnection ¶ added in v1.1.27
func DatabaseConnection() error
func LoadConfig ¶
func LoadConfig()
func NoSqlConnection ¶ added in v1.1.27
func NoSqlConnection()
Types ¶
type Configuration ¶
type Configuration struct { RegisteredConfigStruct map[string]interface{} LoadedConfig map[string]interface{} NoSqlConfig string RelationDBConfig string }
var Config *Configuration
func NewConfig ¶
func NewConfig() *Configuration
func (*Configuration) AddConfig ¶
func (configuration *Configuration) AddConfig(name string, userConfig interface{}) *Configuration
func (*Configuration) AddNoSqlConfig ¶ added in v1.1.28
func (configuration *Configuration) AddNoSqlConfig(name string, userConfig interface{}) *Configuration
func (*Configuration) AddRelationDBConfig ¶ added in v1.1.28
func (configuration *Configuration) AddRelationDBConfig(name string, userConfig interface{}) *Configuration
func (Configuration) Bool ¶ added in v1.1.6
func (configuration Configuration) Bool(key string) (bool, bool)
Bool returns the byte of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not bool.
func (Configuration) Byte ¶ added in v1.1.6
func (configuration Configuration) Byte(key string) (byte, bool)
Byte returns the byte of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not byte.
func (Configuration) Bytes ¶ added in v1.1.6
func (configuration Configuration) Bytes(key string) ([]byte, bool)
Bytes returns the []byte of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not []byte.
func (Configuration) Complex128 ¶ added in v1.1.6
func (configuration Configuration) Complex128(key string) (complex128, bool)
Complex128 returns the complex128 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not complex128.
func (Configuration) Complex64 ¶ added in v1.1.6
func (configuration Configuration) Complex64(key string) (complex64, bool)
Complex64 returns the complex64 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not complex64.
func (Configuration) Float32 ¶ added in v1.1.6
func (configuration Configuration) Float32(key string) (float32, bool)
Float32 returns the float32 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not float32.
func (Configuration) Float64 ¶ added in v1.1.6
func (configuration Configuration) Float64(key string) (float64, bool)
Float64 returns the float64 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not float64.
func (Configuration) Get ¶
func (configuration Configuration) Get(key string) (interface{}, bool)
Get returns the interface of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field.
func (Configuration) GetGetter ¶ added in v1.1.6
func (configuration Configuration) GetGetter(key string) (*structil.Getter, bool)
func (Configuration) GetString ¶
func (configuration Configuration) GetString(key string) string
func (Configuration) GetType ¶ added in v1.1.6
func (configuration Configuration) GetType(key string) (reflect.Type, bool)
GetType returns the reflect.Type object of the original struct field named "name". 2nd return value will be false if the original struct does not have a "name" field.
func (Configuration) GetValue ¶ added in v1.1.6
func (configuration Configuration) GetValue(key string) (reflect.Value, bool)
GetValue returns the reflect.Value object of the original struct field named "name". 2nd return value will be false if the original struct does not have a "name" field.
func (Configuration) Getter ¶ added in v1.1.6
func (configuration Configuration) Getter(key string) *Getter
func (Configuration) Has ¶ added in v1.1.6
func (configuration Configuration) Has(key string) bool
Has tests whether the original struct has a field named "name".
func (Configuration) Int ¶ added in v1.1.6
func (configuration Configuration) Int(key string) (int, bool)
Int returns the int of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not int.
func (Configuration) Int16 ¶ added in v1.1.6
func (configuration Configuration) Int16(key string) (int16, bool)
Int16 returns the int16 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not int16.
func (Configuration) Int32 ¶ added in v1.1.6
func (configuration Configuration) Int32(key string) (int32, bool)
Int32 returns the int32 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not int32.
func (Configuration) Int64 ¶ added in v1.1.6
func (configuration Configuration) Int64(key string) (int64, bool)
Int64 returns the int64 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not int64.
func (Configuration) Int8 ¶ added in v1.1.6
func (configuration Configuration) Int8(key string) (int8, bool)
Int8 returns the int8 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not int8.
func (Configuration) IsArray ¶ added in v1.1.6
func (configuration Configuration) IsArray(key string) bool
IsArray reports whether type of the original struct field named name is slice.
func (Configuration) IsBool ¶ added in v1.1.6
func (configuration Configuration) IsBool(key string) bool
IsBool reports whether type of the original struct field named name is bool.
func (Configuration) IsByte ¶ added in v1.1.6
func (configuration Configuration) IsByte(key string) bool
IsByte reports whether type of the original struct field named name is byte.
func (Configuration) IsBytes ¶ added in v1.1.6
func (configuration Configuration) IsBytes(key string) bool
IsBytes reports whether type of the original struct field named name is []byte.
func (Configuration) IsChan ¶ added in v1.1.6
func (configuration Configuration) IsChan(key string) bool
IsChan reports whether type of the original struct field named name is chan.
func (Configuration) IsComplex128 ¶ added in v1.1.6
func (configuration Configuration) IsComplex128(key string) bool
IsComplex128 reports whether type of the original struct field named name is []byte.
func (Configuration) IsComplex64 ¶ added in v1.1.6
func (configuration Configuration) IsComplex64(key string) bool
IsComplex64 reports whether type of the original struct field named name is []byte.
func (Configuration) IsFloat32 ¶ added in v1.1.6
func (configuration Configuration) IsFloat32(key string) bool
IsFloat32 reports whether type of the original struct field named name is float32.
func (Configuration) IsFloat64 ¶ added in v1.1.6
func (configuration Configuration) IsFloat64(key string) bool
IsFloat64 reports whether type of the original struct field named name is float64.
func (Configuration) IsFunc ¶ added in v1.1.6
func (configuration Configuration) IsFunc(key string) bool
IsFunc reports whether type of the original struct field named name is func.
func (Configuration) IsInt ¶ added in v1.1.6
func (configuration Configuration) IsInt(key string) bool
IsInt reports whether type of the original struct field named name is int.
func (Configuration) IsInt16 ¶ added in v1.1.6
func (configuration Configuration) IsInt16(key string) bool
IsInt16 reports whether type of the original struct field named name is int16.
func (Configuration) IsInt32 ¶ added in v1.1.6
func (configuration Configuration) IsInt32(key string) bool
IsInt32 reports whether type of the original struct field named name is int32.
func (Configuration) IsInt64 ¶ added in v1.1.6
func (configuration Configuration) IsInt64(key string) bool
IsInt64 reports whether type of the original struct field named name is int64.
func (Configuration) IsInt8 ¶ added in v1.1.6
func (configuration Configuration) IsInt8(key string) bool
IsInt8 reports whether type of the original struct field named name is int8.
func (Configuration) IsMap ¶ added in v1.1.6
func (configuration Configuration) IsMap(key string) bool
IsMap reports whether type of the original struct field named name is map.
func (Configuration) IsSlice ¶ added in v1.1.6
func (configuration Configuration) IsSlice(key string) bool
IsSlice reports whether type of the original struct field named name is slice.
func (Configuration) IsString ¶ added in v1.1.6
func (configuration Configuration) IsString(key string) bool
IsString reports whether type of the original struct field named name is string.
func (Configuration) IsStruct ¶ added in v1.1.6
func (configuration Configuration) IsStruct(key string) bool
IsStruct reports whether type of the original struct field named name is struct.
func (Configuration) IsUint ¶ added in v1.1.6
func (configuration Configuration) IsUint(key string) bool
IsUint reports whether type of the original struct field named name is uint.
func (Configuration) IsUint16 ¶ added in v1.1.6
func (configuration Configuration) IsUint16(key string) bool
IsUint16 reports whether type of the original struct field named name is uint16.
func (Configuration) IsUint32 ¶ added in v1.1.6
func (configuration Configuration) IsUint32(key string) bool
IsUint32 reports whether type of the original struct field named name is uint32.
func (Configuration) IsUint64 ¶ added in v1.1.6
func (configuration Configuration) IsUint64(key string) bool
IsUint64 reports whether type of the original struct field named name is uint64.
func (Configuration) IsUint8 ¶ added in v1.1.6
func (configuration Configuration) IsUint8(key string) bool
IsUint8 reports whether type of the original struct field named name is uint8.
func (Configuration) IsUintptr ¶ added in v1.1.6
func (configuration Configuration) IsUintptr(key string) bool
IsUintptr reports whether type of the original struct field named name is uintptr.
func (Configuration) IsUnsafePointer ¶ added in v1.1.6
func (configuration Configuration) IsUnsafePointer(key string) bool
IsUnsafePointer reports whether type of the original struct field named name is []byte.
func (*Configuration) Load ¶
func (configuration *Configuration) Load() map[string]interface{}
func (Configuration) Names ¶ added in v1.1.6
func (configuration Configuration) Names(key string) []string
Names returns names of struct field.
func (Configuration) NumField ¶ added in v1.1.6
func (configuration Configuration) NumField(key string) int
NumField returns num of struct field.
func (Configuration) Slice ¶ added in v1.1.6
func (configuration Configuration) Slice(key string) ([]interface{}, bool)
Slice returns the slice of interface of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not slice of interface.
func (*Configuration) String ¶ added in v1.1.6
func (configuration *Configuration) String(key string) (string, bool)
String returns the string of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not string.
func (Configuration) ToMap ¶ added in v1.1.6
func (configuration Configuration) ToMap(key string) map[string]interface{}
ToMap returns a map converted from this Getter.
func (Configuration) Uint ¶ added in v1.1.6
func (configuration Configuration) Uint(key string) (uint, bool)
Uint returns the uint of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uint.
func (Configuration) Uint16 ¶ added in v1.1.6
func (configuration Configuration) Uint16(key string) (uint16, bool)
Uint16 returns the uint16 of the original struct field named name.Getter 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uint16.
func (Configuration) Uint32 ¶ added in v1.1.6
func (configuration Configuration) Uint32(key string) (uint32, bool)
Uint32 returns the uint32 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uint32.
func (Configuration) Uint64 ¶ added in v1.1.6
func (configuration Configuration) Uint64(key string) (uint64, bool)
Uint64 returns the uint64 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uint64.
func (Configuration) Uint8 ¶ added in v1.1.6
func (configuration Configuration) Uint8(key string) (uint8, bool)
Uint8 returns the uint8 of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uint8.
func (Configuration) Uintptr ¶ added in v1.1.6
func (configuration Configuration) Uintptr(key string) (uintptr, bool)
Uintptr returns the uintptr of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not uintptr.
func (Configuration) UnsafePointer ¶ added in v1.1.6
func (configuration Configuration) UnsafePointer(key string) (unsafe.Pointer, bool)
UnsafePointer returns the unsafe.Pointer of the original struct field named name. 2nd return value will be false if the original struct does not have a "name" field. 2nd return value will be false if type of the original struct "name" field is not unsafe.Pointer.
type LoggerBuilder ¶
type LoggerBuilder struct {
*zap.SugaredLogger
}
LoggerBuilder structure
func InitializeLogger ¶ added in v1.1.27
func InitializeLogger() LoggerBuilder
type MongoCollection ¶
type MongoCollection struct { *mongo.Collection Ctx context.Context CancelFunc context.CancelFunc }
func (MongoCollection) Find ¶
func (collection MongoCollection) Find(filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error, context.Context)
func (MongoCollection) FindOne ¶
func (collection MongoCollection) FindOne(filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
func (MongoCollection) FindOneAndDelete ¶
func (collection MongoCollection) FindOneAndDelete(filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult
func (MongoCollection) FindOneAndUpdate ¶
func (collection MongoCollection) FindOneAndUpdate(filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult
func (MongoCollection) InsertOne ¶
func (collection MongoCollection) InsertOne(document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
func (MongoCollection) WithContext ¶
func (mongoCollection MongoCollection) WithContext() MongoCollection
type MongoDB ¶
var Mongo *MongoDB
func NewNoSqlDB ¶ added in v1.1.27
func NewNoSqlDB() *MongoDB
func (*MongoDB) Collection ¶
func (mongodb *MongoDB) Collection(name string) MongoCollection
type PaginationMeta ¶ added in v1.1.41
type Paginator ¶ added in v1.1.40
type Paginator struct { Meta PaginationMeta `json:"meta"` *paginator.Paginator }
func NewPaginator ¶ added in v1.1.40
func (*Paginator) CursorPaginate ¶ added in v1.1.40
type ResponseBuilder ¶
type ResponseBuilder struct { CodeKeyName string MessageKeyName string DataKeyName string Response }
var Res ResponseBuilder
func (ResponseBuilder) Abort ¶ added in v1.1.7
func (response ResponseBuilder) Abort(c *gin.Context)
func (ResponseBuilder) AbortWithError ¶ added in v1.1.7
func (response ResponseBuilder) AbortWithError(c *gin.Context, err error)
func (ResponseBuilder) AbortWithStatusJSON ¶
func (response ResponseBuilder) AbortWithStatusJSON(c *gin.Context)
func (ResponseBuilder) AsciiJSON ¶ added in v1.1.7
func (response ResponseBuilder) AsciiJSON(c *gin.Context)
func (ResponseBuilder) Build ¶
func (response ResponseBuilder) Build() interface{}
func (ResponseBuilder) Code ¶ added in v1.1.7
func (response ResponseBuilder) Code(status int) ResponseBuilder
func (ResponseBuilder) Data ¶
func (response ResponseBuilder) Data(data interface{}) ResponseBuilder
func (ResponseBuilder) Html ¶ added in v1.1.7
func (response ResponseBuilder) Html(c *gin.Context, name string)
func (ResponseBuilder) IndentedJSON ¶ added in v1.1.7
func (response ResponseBuilder) IndentedJSON(c *gin.Context)
func (ResponseBuilder) Json ¶
func (response ResponseBuilder) Json(c *gin.Context)
func (ResponseBuilder) JsonP ¶ added in v1.1.7
func (response ResponseBuilder) JsonP(c *gin.Context)
func (ResponseBuilder) Message ¶
func (response ResponseBuilder) Message(message string) ResponseBuilder
func (ResponseBuilder) ProtoBuf ¶ added in v1.1.7
func (response ResponseBuilder) ProtoBuf(c *gin.Context)
func (ResponseBuilder) PureJSON ¶ added in v1.1.7
func (response ResponseBuilder) PureJSON(c *gin.Context)
func (ResponseBuilder) Raw ¶ added in v1.1.10
func (response ResponseBuilder) Raw(raw map[string]interface{}) ResponseBuilder
func (ResponseBuilder) Redirect ¶ added in v1.1.7
func (response ResponseBuilder) Redirect(c *gin.Context, location string)
func (*ResponseBuilder) SetCodeKeyName ¶ added in v1.1.31
func (response *ResponseBuilder) SetCodeKeyName(name string) *ResponseBuilder
func (*ResponseBuilder) SetDataKeyName ¶ added in v1.1.31
func (response *ResponseBuilder) SetDataKeyName(name string) *ResponseBuilder
func (*ResponseBuilder) SetMessageKeyName ¶ added in v1.1.31
func (response *ResponseBuilder) SetMessageKeyName(name string) *ResponseBuilder
func (ResponseBuilder) Xml ¶ added in v1.1.7
func (response ResponseBuilder) Xml(c *gin.Context)
func (ResponseBuilder) Yaml ¶ added in v1.1.7
func (response ResponseBuilder) Yaml(c *gin.Context)