Documentation ¶
Index ¶
- Variables
- func ConvertErrorFromHttpClient(err error) error
- func ConvertErrorFromRedis(err error) error
- func GetHttpJsonBodyByType[T any](client *http.Client, logger *slog.Logger, ctx context.Context, endpoint string) (view T, Err error)
- func GetLocalCacheByType[T any](store *bigcache.BigCache, key string) (val T, Err error)
- func GetRedisStringByType[T any](client *redis.Client, unmarshal utility.Unmarshal, logger *slog.Logger, ...) (resp T, Err error)
- func HandleErrorByFiber(c *fiber.Ctx, err error) error
- func NewHttpClient() *http.Client
- func NewLocalCache() (*bigcache.BigCache, error)
- func NewMessageConsumer()
- func NewMessageProducer()
- func NewMySqlGorm(conf *pkg.MySql) (*gorm.DB, error)
- func NewRedis(conf *pkg.Redis) (*redis.Client, error)
- func ParseDataflowByFiber(ingress *dataflow.Message, req any, logger *slog.Logger) (bool, error)
- func ParseQueryByFiber(c *fiber.Ctx, req any, logger *slog.Logger) (bool, error)
- func SetLocalCacheByType[T any](store *bigcache.BigCache, key string, val *T) (Err error)
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var FiberMetadata = newFiberMetadataKey()
View Source
var FiberO11YMetric = wfiber.NewO11YMetric(pkg.Version().ServiceName)
Functions ¶
func ConvertErrorFromHttpClient ¶
ConvertErrorFromHttpClient 還不知道會有怎樣的 http error, 所以只先定義預設錯誤
func ConvertErrorFromRedis ¶
func GetHttpJsonBodyByType ¶
func GetLocalCacheByType ¶
func GetRedisStringByType ¶
func HandleErrorByFiber ¶
func NewHttpClient ¶
func NewLocalCache ¶
func NewLocalCache() (*bigcache.BigCache, error)
func NewMessageConsumer ¶
func NewMessageConsumer()
func NewMessageProducer ¶
func NewMessageProducer()
func ParseDataflowByFiber ¶
func ParseQueryByFiber ¶
func SetLocalCacheByType ¶
Types ¶
type ErrorResponse ¶
func NewErrorResponse ¶
func NewErrorResponse(code int, message string) *ErrorResponse
Click to show internal directories.
Click to hide internal directories.