Versions in this module Expand all Collapse all v1 v1.3.5 Nov 23, 2023 Changes in this version + var FCMServiceConnectError = Error + var FCMServiceSendError = Error type ENVConfig + FirebaseCredential string type IFMC + func NewFMC(ctx IContext) IFMC + SendSimpleMessage func(tokens []string, payload *IFMCMessage) IError + SendSimpleMessages func(payload []IFMCPayload) IError + type IFMCMessage struct + Body string + Data map[string]string + ImageURL string + Title string + type IFMCPayload struct + Message *IFMCMessage + Token string v1.3.2 Nov 21, 2023 v1.3.0 Nov 21, 2023 Changes in this version + type IFMC interface + Send func(data map[string]string, token string) error + SendAll func(data map[string]string, tokens []string) error + SendTopic func(data map[string]string, topic string) error + func NewFMCService(ctx IContext, bgCtx context.Context, credentialJSON []byte) (IFMC, error) v1.2.0 Oct 27, 2023 Changes in this version + const And + const DatabaseDriverMSSQL + const DatabaseDriverMYSQL + const DatabaseDriverOracle + const DatabaseDriverPOSTGRES + const DateFormat + const MustMatch + const Or + const TimeFormat + const TimeFormatRegex + const Wildcard + var ArrayBetweenM = func(field string, min int, max int) *IValidMessage + var ArrayM = func(field string) *IValidMessage + var ArrayMaxM = func(field string, max int) *IValidMessage + var ArrayMinM = func(field string, min int) *IValidMessage + var ArraySizeM = func(field string, size int) *IValidMessage + var Base64M = func(field string) *IValidMessage + var BooleanM = func(field string) *IValidMessage + var DateTimeAfterM = func(field string, after string) *IValidMessage + var DateTimeBeforeM = func(field string, before string) *IValidMessage + var DateTimeM = func(field string) *IValidMessage + var EmailM = func(field string) *IValidMessage + var EmailServiceParserError = Error + var EmailServiceSendFailed = Error + var ExistsM = func(field string) *IValidMessage + var FloatNumberBetweenM = func(field string, min float64, max float64) *IValidMessage + var FloatNumberMaxM = func(field string, size float64) *IValidMessage + var FloatNumberMinM = func(field string, size float64) *IValidMessage + var IPM = func(field string) *IValidMessage + var InM = func(field string, rules string) *IValidMessage + var JSONArrayM = func(field string) *IValidMessage + var JSONM = func(field string) *IValidMessage + var JSONObjectEmptyM = func(field string) *IValidMessage + var JSONObjectM = func(field string) *IValidMessage + var MQError = Error + var NumberBetweenM = func(field string, min int64, max int64) *IValidMessage + var NumberM = func(field string) *IValidMessage + var NumberMaxM = func(field string, size int64) *IValidMessage + var NumberMinM = func(field string, size int64) *IValidMessage + var ObjectEmptyM = func(field string) *IValidMessage + var RequiredM = func(field string) *IValidMessage + var StrMaxM = func(field string, max int) *IValidMessage + var StrMinM = func(field string, min int) *IValidMessage + var StringContainM = func(field string, substr string) *IValidMessage + var StringEndWithM = func(field string, substr string) *IValidMessage + var StringLowercaseM = func(field string) *IValidMessage + var StringM = func(field string) *IValidMessage + var StringNotContainM = func(field string, substr string) *IValidMessage + var StringStartWithM = func(field string, substr string) *IValidMessage + var StringUppercaseM = func(field string) *IValidMessage + var TimeAfterM = func(field string, after string) *IValidMessage + var TimeBeforeM = func(field string, before string) *IValidMessage + var TimeM = func(field string) *IValidMessage + var URLM = func(field string) *IValidMessage + var UniqueM = func(field string) *IValidMessage + func CaptureError(ctx IContext, level sentry.Level, err error, args ...interface{}) + func CaptureErrorEcho(ctx echo.Context, level sentry.Level, err error) + func CaptureHTTPError(ctx IHTTPContext, level sentry.Level, err error, args ...interface{}) + func CaptureSimpleError(level sentry.Level, err error, args ...interface{}) + func Core(options *HTTPContextOptions) func(next echo.HandlerFunc) echo.HandlerFunc + func Crash(err error) error + func ErrorToJson(err error) (m map[string]jsonErr) + func Fake(a interface{}) error + func GetBodyString(c echo.Context) []byte + func HTTPMiddlewareCORS(options *HTTPContextOptions) echo.MiddlewareFunc + func HTTPMiddlewareCreateLogger(next echo.HandlerFunc) echo.HandlerFunc + func HTTPMiddlewareFromCache(key func(IHTTPContext) string) echo.MiddlewareFunc + func HTTPMiddlewareHandleError(env IENV) echo.HTTPErrorHandler + func HTTPMiddlewareHandleNotFound(c echo.Context) error + func HTTPMiddlewareRateLimit(options *HTTPContextOptions) echo.MiddlewareFunc + func HTTPMiddlewareRecoverWithConfig(env IENV, config middleware.RecoverConfig) echo.MiddlewareFunc + func HTTPMiddlewareRequestID() echo.MiddlewareFunc + func IsError(err error) bool + func NewHTTPServer(options *HTTPContextOptions) *echo.Echo + func Paginate(db *gorm.DB, model interface{}, options *models.PageOptions) (*models.PageResponse, error) + func Recover(textError string) + func SetSearch(db *gorm.DB, keywordCondition *KeywordConditionWrapper) *gorm.DB + func SetSearchSimple(db *gorm.DB, q string, columns []string) *gorm.DB + func StartHTTPServer(e *echo.Echo, env IENV) + func WithHTTPContext(h HandlerFunc) echo.HandlerFunc + type ArchiveByteBody struct + File []byte + Name string + type ArchiverOptions struct + type BaseValidator struct + func (b *BaseValidator) AddValidator(errs ...*Valid) + func (b *BaseValidator) Error() IError + func (b *BaseValidator) GetValidator() *Valid + func (b *BaseValidator) IsArrayBetween(array interface{}, min int, max int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsArrayMax(array interface{}, size int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsArrayMin(array interface{}, size int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsArraySize(array interface{}, size int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsBase64(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsBoolRequired(value interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsCustom(customFunc func() (bool, *IValidMessage)) (bool, *IValidMessage) + func (b *BaseValidator) IsDateTime(input *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsDateTimeAfter(input *string, after *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsDateTimeBefore(input *string, before *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsEmail(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsExists(ctx IContext, field *string, table string, column string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsExistsWithCondition(ctx IContext, table string, condition map[string]interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsFloatNumberBetween(field *float64, min float64, max float64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsFloatNumberMax(field *float64, max float64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsFloatNumberMin(field *float64, min float64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsIP(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONArray(field *json.RawMessage, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONArrayMax(field *json.RawMessage, max int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONArrayMin(field *json.RawMessage, min int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONBoolPathRequired(json *json.RawMessage, path string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONObject(field *json.RawMessage, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONObjectNotEmpty(field *json.RawMessage, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONObjectPath(j *json.RawMessage, path string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONPathRequireNotEmpty(j *json.RawMessage, path string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONPathRequired(j *json.RawMessage, path string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONPathStrIn(json *json.RawMessage, path string, rules string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONRequired(field *json.RawMessage, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsJSONStrPathRequired(json *json.RawMessage, path string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsMongoExistsWithCondition(ctx IContext, table string, filter interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsMongoStrUnique(ctx IContext, table string, filter interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsNotEmptyObjectRequired(value interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsNumberBetween(field *int64, min int64, max int64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsNumberMax(field *int64, max int64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsNumberMin(field *int64, min int64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsRequired(field interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsRequiredArray(array interface{}, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStrIn(input *string, rules string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStrMax(input *string, size int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStrMin(input *string, size int, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStrRequired(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStrUnique(ctx IContext, field *string, table string, column string, except string, ...) (bool, *IValidMessage) + func (b *BaseValidator) IsStringContain(field *string, substr string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringEndWith(field *string, substr string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringLowercase(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringNotContain(field *string, substr string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringNumber(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringNumberMin(field *string, min int64, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringStartWith(field *string, substr string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsStringUppercase(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsTime(input *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsTimeAfter(input *string, after *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsTimeBefore(input *string, before *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsTimeRequired(field *time.Time, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) IsURL(field *string, fieldPath string) (bool, *IValidMessage) + func (b *BaseValidator) LoopJSONArray(j *json.RawMessage) []interface{} + func (b *BaseValidator) Merge(errs ...*Valid) IError + func (b *BaseValidator) Must(condition bool, msg *IValidMessage) bool + func (b *BaseValidator) SetPrefix(prefix string) + type ContextOptions struct + Cache ICache + Caches map[string]ICache + DATA map[string]interface{} + DB *gorm.DB + DBS map[string]*gorm.DB + ENV IENV + MQ IMQ + MongoDB IMongoDB + MongoDBS map[string]IMongoDB + type ContextUser struct + Data map[string]string + Email string + ID string + Name string + Segment string + Username string + type CronjobContext struct + func (c CronjobContext) AddJob(job *gocron.Scheduler, handlerFunc func(ctx ICronjobContext) error) + func (c CronjobContext) Job() *gocron.Scheduler + func (c CronjobContext) Start() + type CronjobContextOptions struct + ContextOptions *ContextOptions + TimeLocation *time.Location + type Database struct + Driver string + Host string + Name string + Password string + Port string + User string + func NewDatabase(env *ENVConfig) *Database + func NewDatabaseWithConfig(env *ENVConfig, config *gorm.Config) *Database + func (db *Database) Connect() (*gorm.DB, error) + type DatabaseCache struct + Host string + Port string + func NewCache(env *ENVConfig) *DatabaseCache + func (r DatabaseCache) Connect() (ICache, error) + type DatabaseMongo struct + Host string + Name string + Password string + Port string + UserName string + func NewDatabaseMongo(env *ENVConfig) *DatabaseMongo + func (db *DatabaseMongo) Connect() (IMongoDB, error) + type Error struct + Code string + Data interface{} + Fields interface{} + Message interface{} + Status int + func (c Error) Error() string + func (c Error) GetCode() string + func (c Error) GetMessage() interface{} + func (c Error) GetStatus() int + func (c Error) JSON() interface{} + func (c Error) OriginalError() error + type FieldError struct + Code string + Fields interface{} + Message string + func (FieldError) GetStatus() int + func (f FieldError) Error() string + func (f FieldError) GetCode() string + func (f FieldError) GetMessage() interface{} + func (f FieldError) JSON() interface{} + func (f FieldError) OriginalError() error + func (f FieldError) OriginalErrorMessage() string + type File struct + func (f File) Name() string + func (f File) Value() []byte + type HTTPContext struct + func (c *HTTPContext) BindOnly(i interface{}) IError + func (c *HTTPContext) BindWithValidate(ctx IValidateContext) IError + func (c *HTTPContext) BindWithValidateJWT(ctx IValidateContext) IError + func (c *HTTPContext) BindWithValidateMessage(ctx IValidateContext) IError + func (c *HTTPContext) GetJWT() string + func (c *HTTPContext) GetMessage() string + func (c *HTTPContext) GetPageOptions() *models.PageOptions + func (c *HTTPContext) GetPageOptionsWithOptions(options *PageOptionsOptions) *models.PageOptions + func (c *HTTPContext) GetSignature() string + func (c *HTTPContext) Log() ILogger + func (c *HTTPContext) NewError(err error, errorType IError, args ...interface{}) IError + func (c *HTTPContext) WithSaveCache(data interface{}, key string, duration time.Duration) interface{} + func (c HTTPContext) GetUserAgent() *user_agent.UserAgent + type HTTPContextOptions struct + AllowHeaders []string + AllowOrigins []string + ContextOptions *ContextOptions + RateLimit *middleware.RateLimiterMemoryStoreConfig + type HandlerFunc func(IHTTPContext) error + type IArchiver interface + FromBytes func(fileName string, body []ArchiveByteBody, options *ArchiverOptions) ([]byte, IError) + FromURLs func(fileName string, urls []string, options *ArchiverOptions) ([]byte, IError) + func NewArchiver(ctx IContext) IArchiver + type ICSV interface + ReadFromFile func(data []byte, options *ICSVOptions) ([]T, error) + ReadFromFileMaps func(data []byte, options *ICSVOptions) ([]map[string]interface{}, error) + ReadFromPath func(path string, options *ICSVOptions) ([]T, error) + ReadFromString func(data string, options *ICSVOptions) ([]T, error) + ReadFromURL func(url string, options *ICSVOptions) ([]T, error) + func NewCSV(ctx IContext) ICSV[T] + type ICSVOptions struct + FirstRowIsHeader bool + Separator string + type ICache interface + Close func() + Del func(key string) error + Get func(dest interface{}, key string) error + GetJSON func(dest interface{}, key string) error + Set func(key string, value interface{}, expiration time.Duration) error + SetJSON func(key string, value interface{}, expiration time.Duration) error + type IContext interface + Cache func() ICache + Caches func(name string) ICache + DB func() *gorm.DB + DBMongo func() IMongoDB + DBS func(name string) *gorm.DB + DBSMongo func(name string) IMongoDB + ENV func() IENV + GetAllData func() map[string]interface{} + GetData func(name string) interface{} + GetUser func() *ContextUser + Log func() ILogger + MQ func() IMQ + NewError func(err error, errorType IError, args ...interface{}) IError + Requester func() IRequester + SetData func(name string, data interface{}) + SetUser func(user *ContextUser) + Type func() consts.ContextType + func NewContext(options *ContextOptions) IContext + type ICronjobContext interface + AddJob func(job *gocron.Scheduler, handlerFunc func(ctx ICronjobContext) error) + Job func() *gocron.Scheduler + Start func() + func NewCronjobContext(options *CronjobContextOptions) ICronjobContext + type IEmail interface + ParseHTMLToString func(path string, data interface{}) (string, IError) + SendHTML func(from string, to []string, subject string, body string) IError + SendHTMLWithAttach func(from string, to []string, subject string, body string, file []byte, ...) IError + SendText func(from string, to []string, subject string, body string) IError + func NewEmail(ctx IContext) IEmail + type IError interface + Error func() string + GetCode func() string + GetMessage func() interface{} + GetStatus func() int + JSON func() interface{} + OriginalError func() error + func DBErrorToIError(err error) IError + func MockIError(args mock.Arguments, index int) IError + func NewValidatorFields(fields interface{}) IError + func RequesterToStruct(desc interface{}, requester func() (*RequestResponse, error)) IError + func RequesterToStructPagination(items interface{}, options *models.PageOptions, ...) (*models.PageResponse, IError) + type IFile interface + Name func() string + Value func() []byte + func NewFile(name string, value []byte) IFile + type IHTTPContext interface + BindOnly func(i interface{}) IError + BindWithValidate func(ctx IValidateContext) IError + BindWithValidateJWT func(ctx IValidateContext) IError + BindWithValidateMessage func(ctx IValidateContext) IError + GetMessage func() string + GetPageOptions func() *models.PageOptions + GetPageOptionsWithOptions func(options *PageOptionsOptions) *models.PageOptions + GetSignature func() string + GetUserAgent func() *user_agent.UserAgent + WithSaveCache func(data interface{}, key string, duration time.Duration) interface{} + func NewHTTPContext(ctx echo.Context, options *HTTPContextOptions) IHTTPContext + type ILogger interface + Debug func(args ...interface{}) + DebugWithSkip func(skip int, args ...interface{}) + Error func(message error, args ...interface{}) + ErrorWithSkip func(skip int, message error, args ...interface{}) + Info func(args ...interface{}) + Warn func(args ...interface{}) + type IMQ interface + Close func() + Conn func() *amqp.Connection + Consume func(ctx IMQContext, name string, onConsume func(message amqp.Delivery), ...) + PublishJSON func(name string, data interface{}, options *MQPublishOptions) error + ReConnect func() + type IMQContext interface + AddConsumer func(handlerFunc func(ctx IMQContext)) + Consume func(name string, onConsume func(message amqp.Delivery), options *MQConsumeOptions) + Start func() + func NewMQContext(options *MQContextOptions) IMQContext + func NewMQServer(options *MQContextOptions) IMQContext + type IMongoDB interface + Close func() + Count func(coll string, filter interface{}, opts ...*options.CountOptions) (int64, error) + Create func(coll string, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error) + CreateIndex func(coll string, models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error) + DB func() *mongo.Database + DeleteMany func(coll string, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) + DeleteOne func(coll string, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) + Drop func(coll string) error + DropAll func(coll string, opts ...*options.DropIndexesOptions) (*MongoDropIndexResult, error) + DropIndex func(coll string, name string, opts ...*options.DropIndexesOptions) (*MongoDropIndexResult, error) + Find func(dest interface{}, coll string, filter interface{}, ...) error + FindAggregate func(dest interface{}, coll string, pipeline interface{}, ...) error + FindAggregateOne func(dest interface{}, coll string, pipeline interface{}, ...) error + FindAggregatePagination func(dest interface{}, coll string, pipeline interface{}, ...) (*models.PageResponse, error) + FindOne func(dest interface{}, coll string, filter interface{}, ...) error + FindOneAndDelete func(coll string, filter interface{}, opts ...*options.FindOneAndDeleteOptions) error + FindOneAndUpdate func(dest interface{}, coll string, filter interface{}, update interface{}, ...) error + FindPagination func(dest interface{}, coll string, filter interface{}, ...) (*models.PageResponse, error) + Helper func() IMongoDBHelper + ListIndex func(coll string, opts ...*options.ListIndexesOptions) ([]MongoListIndexResult, error) + UpdateOne func(coll string, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error) + type IMongoDBHelper interface + Filter func(options *MongoFilterOptions) bson.M + Lookup func(options *MongoLookupOptions) bson.M + Match func(options bson.M) bson.M + Or func(options []bson.M) bson.M + Project func(options bson.M) bson.M + ReplaceRoot func(options interface{}) bson.M + Set func(options bson.M) bson.M + Size func(expression string) bson.M + Unwind func(field string) bson.M + func NewMongoHelper() IMongoDBHelper + type IMongoIndexBatch interface + Name func() string + Run func() error + type IMongoIndexer interface + Add func(batch IMongoIndexBatch) + Execute func() error + func NewMongoIndexer(ctx IContext) IMongoIndexer + type IRequester interface + Create func(method consts.RequesterMethodType, url string, body interface{}, ...) (*RequestResponse, error) + Delete func(url string, options *RequesterOptions) (*RequestResponse, error) + Get func(url string, options *RequesterOptions) (*RequestResponse, error) + Patch func(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + Post func(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + Put func(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + func NewRequester(ctx IContext) IRequester + type ISeed interface + Run func() error + type IValidMessage struct + Code string + Data interface{} + Message string + Name string + func (f IValidMessage) Error() string + type IValidate interface + Valid func() IError + type IValidateContext interface + Valid func(ctx IContext) IError + type KeywordCondition string + type KeywordConditionWrapper struct + Condition KeywordCondition + KeywordOptions []KeywordOptions + func NewKeywordAndCondition(keywordOptions []KeywordOptions) *KeywordConditionWrapper + func NewKeywordOrCondition(keywordOptions []KeywordOptions) *KeywordConditionWrapper + type KeywordOptions struct + Key string + Type KeywordType + Value string + func NewKeywordMustMatchOption(key string, value string) *KeywordOptions + func NewKeywordMustMatchOptions(keys []string, value string) []KeywordOptions + func NewKeywordWildCardOption(key string, value string) *KeywordOptions + func NewKeywordWildCardOptions(keys []string, value string) []KeywordOptions + type KeywordType string + type Logger struct + HostName string + RequestID string + Type consts.ContextType + func NewLogger(ctx IContext) *Logger + func NewLoggerSimple() *Logger + func (logger *Logger) Debug(args ...interface{}) + func (logger *Logger) DebugWithSkip(skip int, args ...interface{}) + func (logger *Logger) Error(message error, args ...interface{}) + func (logger *Logger) ErrorWithSkip(skip int, message error, args ...interface{}) + func (logger *Logger) Info(args ...interface{}) + func (logger *Logger) Warn(args ...interface{}) + type MQ struct + Host string + LogLevel logrus.Level + Password string + Port string + User string + func NewMQ(env *ENVConfig) *MQ + func (m *MQ) Connect() (IMQ, error) + func (m *MQ) ReConnect() (*amqp.Connection, error) + type MQConsumeOptions struct + Args amqp.Table + AutoAck bool + AutoDelete bool + Consumer string + Durable bool + Exclusive bool + NoLocal bool + NoWait bool + type MQContext struct + func (c *MQContext) AddConsumer(handlerFunc func(ctx IMQContext)) + func (c *MQContext) Consume(name string, onConsume func(message amqp.Delivery), options *MQConsumeOptions) + func (c *MQContext) Start() + type MQContextOptions struct + ContextOptions *ContextOptions + type MQPublishOptions struct + Args amqp.Table + AutoDelete bool + DeliveryMode uint8 + Durable bool + Exchange string + Exclusive bool + Immediate bool + Mandatory bool + MessageID string + NoWait bool + type MongoDB struct + func (m MongoDB) Close() + func (m MongoDB) Count(coll string, filter interface{}, opts ...*options.CountOptions) (int64, error) + func (m MongoDB) Create(coll string, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error) + func (m MongoDB) CreateIndex(coll string, models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error) + func (m MongoDB) DB() *mongo.Database + func (m MongoDB) DeleteMany(coll string, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) + func (m MongoDB) DeleteOne(coll string, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) + func (m MongoDB) Drop(coll string) error + func (m MongoDB) DropAll(coll string, opts ...*options.DropIndexesOptions) (*MongoDropIndexResult, error) + func (m MongoDB) DropIndex(coll string, name string, opts ...*options.DropIndexesOptions) (*MongoDropIndexResult, error) + func (m MongoDB) Find(dest interface{}, coll string, filter interface{}, ...) error + func (m MongoDB) FindAggregate(dest interface{}, coll string, pipeline interface{}, ...) error + func (m MongoDB) FindAggregateOne(dest interface{}, coll string, pipeline interface{}, ...) error + func (m MongoDB) FindAggregatePagination(dest interface{}, coll string, pipeline interface{}, ...) (*models.PageResponse, error) + func (m MongoDB) FindOne(dest interface{}, coll string, filter interface{}, ...) error + func (m MongoDB) FindOneAndDelete(coll string, filter interface{}, opts ...*options.FindOneAndDeleteOptions) error + func (m MongoDB) FindOneAndUpdate(dest interface{}, coll string, filter interface{}, update interface{}, ...) error + func (m MongoDB) FindPagination(dest interface{}, coll string, filter interface{}, ...) (*models.PageResponse, error) + func (m MongoDB) Helper() IMongoDBHelper + func (m MongoDB) ListIndex(coll string, opts ...*options.ListIndexesOptions) ([]MongoListIndexResult, error) + func (m MongoDB) UpdateOne(coll string, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error) + type MongoDropIndexResult struct + DropCount int64 + type MongoFilterOptions struct + As string + Condition bson.M + Input string + type MongoIndexer struct + Batches []IMongoIndexBatch + func (i *MongoIndexer) Add(batch IMongoIndexBatch) + func (i *MongoIndexer) Execute() error + type MongoListIndexResult struct + Key map[string]int64 + Name string + Version int64 + type MongoLookupOptions struct + As string + ForeignField string + From string + LocalField string + type PageOptionsOptions struct + OrderByAllowed []string + type RequestResponse struct + ContentLength int64 + Data map[string]interface{} + ErrorCode string + Header http.Header + RawData []byte + Request *http.Request + StatusCode int + TLS *tls.ConnectionState + Trailer http.Header + TransferEncoding []string + Uncompressed bool + func RequestWrapper(dest interface{}, requester func() (*RequestResponse, error)) (*RequestResponse, error) + type Requester struct + func (r Requester) Create(method consts.RequesterMethodType, url string, body interface{}, ...) (*RequestResponse, error) + func (r Requester) Delete(url string, options *RequesterOptions) (*RequestResponse, error) + func (r Requester) Get(url string, options *RequesterOptions) (*RequestResponse, error) + func (r Requester) Patch(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + func (r Requester) Post(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + func (r Requester) Put(url string, body interface{}, options *RequesterOptions) (*RequestResponse, error) + type RequesterOptions struct + BaseURL string + Headers http.Header + IsBodyRawByte bool + IsMultipartForm bool + IsURLEncode bool + Params xurl.Values + RetryCount int + Timeout *time.Duration + Transport *http.Transport + type Seeder struct + func NewSeeder() *Seeder + func (receiver Seeder) Add(seeder ISeed) error + type Valid struct + func NewValid() *Valid + func (v *Valid) Add(err ...error) + func (v *Valid) Error() string + func (v *Valid) GetCode() string + func (v *Valid) GetMessage() interface{} + func (v *Valid) GetStatus() int + func (v *Valid) JSON() interface{} + func (v *Valid) Must(x bool, msg *IValidMessage) bool + func (v *Valid) OriginalError() error + func (v *Valid) OriginalErrorMessage() string + func (v *Valid) Valid() IError + type ValidError struct + func (err *ValidError) Error() string + func (err *ValidError) Errors() []error + func (err *ValidError) Strings() []string + type Validator struct + func (cv *Validator) Validate(i interface{}) error v1.1.0 Oct 19, 2023 Changes in this version + const EnvFileName + const EnvTestFileName + type ENVConfig struct + ABCIEndpoint string + CacheHost string + CachePort string + DBDriver string + DBHost string + DBMongoHost string + DBMongoName string + DBMongoPassword string + DBMongoPort string + DBMongoUserName string + DBName string + DBPassword string + DBPort string + DBUser string + DIDKeyTypeDefault string + DIDMethodDefault string + ENV string + EmailPassword string + EmailPort int + EmailSender string + EmailServer string + EmailUsername string + Host string + LogHost string + LogLevel logrus.Level + LogPort string + MQHost string + MQPassword string + MQPort string + MQUser string + S3AccessKey string + S3Bucket string + S3Endpoint string + S3IsHTTPS bool + S3Region string + S3SecretKey string + SentryDSN string + Service string + WinRMHost string + WinRMPassword string + WinRMUser string + type ENVType struct + func (e ENVType) All() map[string]string + func (e ENVType) Bool(key string) bool + func (e ENVType) Config() *ENVConfig + func (e ENVType) Int(key string) int + func (e ENVType) IsDev() bool + func (e ENVType) IsMock() bool + func (e ENVType) IsProd() bool + func (e ENVType) IsTest() bool + func (e ENVType) String(key string) string + type IENV interface + All func() map[string]string + Bool func(key string) bool + Config func() *ENVConfig + Int func(key string) int + IsDev func() bool + IsMock func() bool + IsProd func() bool + IsTest func() bool + String func(key string) string + func NewENVPath(path string) IENV + func NewEnv() IENV + type IS3 interface + GetObject func(path string, opts *ss3.GetObjectInput) (*ss3.GetObjectOutput, error) + PutObject func(objectName string, file io.ReadSeeker, opts *ss3.PutObjectInput, ...) (*ss3.PutObjectOutput, error) + PutObjectByURL func(objectName string, url string, opts *ss3.PutObjectInput, ...) (*ss3.PutObjectOutput, error) + type S3Config struct + AccessKey string + Bucket string + Endpoint string + IsHTTPS bool + Region string + SecretKey string + func NewS3(env *core.ENVConfig) *S3Config + func (r *S3Config) Connect() (IS3, error) + type UploadOptions struct + Height int64 + Quality int64 + Width int64 v1.0.3 Oct 19, 2023 v1.0.2 Oct 19, 2023 v1.0.1 Oct 18, 2023 Changes in this version + func TestOutput()