extension

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHeader

func SetHeader(name string, v func() IHeader)

func SetLog

func SetLog(name string, v func() ILogger)

func SetMessage

func SetMessage(name string, v func() IEventMessage)

func SetSign

func SetSign(name string, v func() ISign)

func SetToken

func SetToken(name string, v func() IToken)

Types

type IError

type IError interface {
	Process(ctx context.Context, code int, msg string)
}

type IEventMessage

type IEventMessage interface {
	// init event message client
	InitMessageClient()
	// listen event message
	SubEventMessage(f interface{})
	// stop event message receive
	Stop()
}

func GetMessage

func GetMessage(name string) IEventMessage

type IHeader

type IHeader interface {
	Do(ctx context.Context) map[string]string
}

header interface

func GetHeader

func GetHeader(name string) IHeader

type ILogger

type ILogger interface {
	SetLevel(level int)
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})
	Info(v ...interface{})
	Infof(format string, v ...interface{})
	Warn(v ...interface{})
	Warnf(format string, v ...interface{})
	Error(v ...interface{})
	Errorf(format string, v ...interface{})
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
}

log interface

func GetLog

func GetLog(name string) ILogger

type ISign

type ISign interface {
	Sign(ctx context.Context) string
}

sign interface implemented this interface and supports custom signatures

func GetSign

func GetSign(name string) ISign

type IToken

type IToken interface {
	Do(ctx context.Context) (string, error)
	Refresh(ctx context.Context) (string, error)
}

token interface implemented this interface and supports custom token manage

func GetToken

func GetToken(name string) IToken

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL