Documentation
¶
Index ¶
- Constants
- Variables
- func NewConfig(domain Domain, appSettings *config.AppSettings, opts ...ConfigOpt) *config.Config
- func SetLogger(logger log.Logger) func(o *configOpt)
- func SetLoggerLevel(logLevel LoggerLevel) func(o *configOpt)
- func SetStore(store store.Store) func(o *configOpt)
- type ConfigOpt
- type Context
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Get(key string) (value interface{}, exists bool)
- func (c *Context) GetHTTPStatusCode() int
- func (c *Context) GetHeader() *OapiHeader
- func (c *Context) GetRequestID() string
- func (c *Context) Set(key string, value interface{})
- func (c *Context) Value(key interface{}) interface{}
- type Domain
- type LoggerLevel
- type OapiHeader
- type OapiRequest
- type OapiResponse
Constants ¶
View Source
const ChallengeResponseFormat = `{"challenge":"%s"}`
View Source
const ResponseFormat = `{"codemsg":"%s"}`
View Source
const SdkVersion = "v1.1.44"
Variables ¶
View Source
var ( GetISVAppSettingsByEnv = config.GetISVAppSettingsByEnv GetInternalAppSettingsByEnv = config.GetInternalAppSettingsByEnv NewISVAppSettings = config.NewISVAppSettingsByOpts NewInternalAppSettings = config.NewInternalAppSettingsByOpts SetAppCredentials = config.SetAppCredentials SetAppEventKey = config.SetAppEventKey SetHelpDeskCredentials = config.SetHelpDeskCredentials )
Functions ¶
func SetLoggerLevel ¶ added in v1.1.41
func SetLoggerLevel(logLevel LoggerLevel) func(o *configOpt)
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func WarpContext ¶
Deprecated, please use `WrapContext`
func WrapContext ¶ added in v1.1.8
func (*Context) Get ¶
Get returns the value for the given key, ie: (value, true). If the value does not exists it returns (nil, false)
func (*Context) GetHTTPStatusCode ¶
func (*Context) GetHeader ¶ added in v1.1.26
func (c *Context) GetHeader() *OapiHeader
func (*Context) GetRequestID ¶
type Domain ¶ added in v1.1.41
type Domain string
const ( DomainFeiShu Domain = Domain(constants.DomainFeiShu) DomainLarkSuite Domain = Domain(constants.DomainLarkSuite) )
type LoggerLevel ¶ added in v1.1.41
type LoggerLevel int
const ( LoggerLevelDebug LoggerLevel = LoggerLevel(log.LevelDebug) LoggerLevelInfo LoggerLevel = LoggerLevel(log.LevelInfo) LoggerLevelWarn LoggerLevel = LoggerLevel(log.LevelWarn) LoggerLevelError LoggerLevel = LoggerLevel(log.LevelError) )
type OapiHeader ¶ added in v1.1.41
type OapiHeader struct {
// contains filtered or unexported fields
}
func NewOapiHeader ¶ added in v1.1.41
func NewOapiHeader(m map[string][]string) *OapiHeader
func (OapiHeader) GetFirstValue ¶ added in v1.1.41
func (h OapiHeader) GetFirstValue(name string) string
func (OapiHeader) GetMultiValues ¶ added in v1.1.41
func (h OapiHeader) GetMultiValues(name string) []string
func (OapiHeader) GetNames ¶ added in v1.1.41
func (h OapiHeader) GetNames() []string
type OapiRequest ¶ added in v1.1.41
type OapiRequest struct { Ctx context.Context Uri string Header *OapiHeader Body string }
func ToOapiRequest ¶ added in v1.1.41
func ToOapiRequest(request *http.Request) (*OapiRequest, error)
type OapiResponse ¶ added in v1.1.41
type OapiResponse struct { StatusCode int ContentType string Header map[string][]string Body string }
func NewOapiResponseOfErr ¶ added in v1.1.41
func NewOapiResponseOfErr(err error) *OapiResponse
func (*OapiResponse) Write ¶ added in v1.1.41
func (r *OapiResponse) Write(statusCode int, contentType string, body string)
func (OapiResponse) WriteTo ¶ added in v1.1.41
func (r OapiResponse) WriteTo(response http.ResponseWriter) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.