Documentation ¶
Index ¶
- Constants
- func DispatchEvent(logger *logrus.Logger, events ...domain_events.IEvent)
- func GetEnv(name string) string
- func GetEnvWithDefaultValue(name string, defaultValue string) string
- func GetOauthPrivateKeyFile() ([]byte, error)
- func GetOauthPublicKeyFile() ([]byte, error)
- func GetRootPath() string
- func GracefulShutdown(ctx context.Context, log *logrus.Logger, timeout time.Duration, ...) <-chan struct{}
- func LoadEnv() error
- func NewLogInstance(logOptions ...LogOption) *logrus.Logger
- func RandomString(n int) string
- func ToKebabCase(str string) string
- func ToSnakeCase(str string) string
- type DefaultFieldHook
- type GracefulOperation
- type IResponse
- type IWorkerPool
- type LogConfig
- type LogOption
- type Meta
- type WorkerPool
Constants ¶
View Source
const Default = "default"
Variables ¶
This section is empty.
Functions ¶
func DispatchEvent ¶
func DispatchEvent(logger *logrus.Logger, events ...domain_events.IEvent)
func GetEnvWithDefaultValue ¶
func GetOauthPrivateKeyFile ¶
func GetOauthPublicKeyFile ¶
func GetRootPath ¶
func GetRootPath() string
func GracefulShutdown ¶
func NewLogInstance ¶
NewLogInstance ...
func RandomString ¶
func ToKebabCase ¶
func ToSnakeCase ¶
Types ¶
type DefaultFieldHook ¶
type DefaultFieldHook struct {
// contains filtered or unexported fields
}
func (*DefaultFieldHook) Levels ¶
func (h *DefaultFieldHook) Levels() []logrus.Level
type GracefulOperation ¶
type IResponse ¶
type IResponse[TData, ITMeta any] interface { MakeMetaData(message string, data map[string]ITMeta, page *int, perPage *int, totalPage *int) BuildResponse() *response[TData, ITMeta] }
func NewResponse ¶
type IWorkerPool ¶
type IWorkerPool interface { Run(ctx context.Context) WaitWorker() GetResults() []result AddTask(task task) SetWorkerNumber(total int) GetTotalSuccessJob() int }
func NewWorkerPool ¶
func NewWorkerPool() IWorkerPool
type LogOption ¶
type LogOption func(*LogConfig)
func IsProduction ¶
func LogAdditionalFields ¶
func LogEnvironment ¶
type WorkerPool ¶
type WorkerPool struct { TotalSuccessJob int // contains filtered or unexported fields }
func (*WorkerPool) AddTask ¶
func (wa *WorkerPool) AddTask(task task)
func (*WorkerPool) GetResults ¶
func (wa *WorkerPool) GetResults() []result
func (*WorkerPool) GetTotalSuccessJob ¶
func (wa *WorkerPool) GetTotalSuccessJob() int
func (*WorkerPool) Run ¶
func (wa *WorkerPool) Run(ctx context.Context)
func (*WorkerPool) SetWorkerNumber ¶
func (wa *WorkerPool) SetWorkerNumber(total int)
func (*WorkerPool) WaitWorker ¶
func (wa *WorkerPool) WaitWorker()
Click to show internal directories.
Click to hide internal directories.