core

package
v1.1.48 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 11 Imported by: 8

Documentation

Index

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 NewConfig added in v1.1.41

func NewConfig(domain Domain, appSettings *config.AppSettings, opts ...ConfigOpt) *config.Config

func SetLogger added in v1.1.41

func SetLogger(logger log.Logger) func(o *configOpt)

func SetLoggerLevel added in v1.1.41

func SetLoggerLevel(logLevel LoggerLevel) func(o *configOpt)

func SetStore added in v1.1.41

func SetStore(store store.Store) func(o *configOpt)

Types

type ConfigOpt added in v1.1.41

type ConfigOpt func(o *configOpt)

type Context

type Context struct {
	// contains filtered or unexported fields
}

func WarpContext

func WarpContext(c context.Context) *Context

Deprecated, please use `WrapContext`

func WrapContext added in v1.1.8

func WrapContext(c context.Context) *Context

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

func (*Context) Err

func (c *Context) Err() error

func (*Context) Get

func (c *Context) Get(key string) (value interface{}, exists bool)

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 (c *Context) GetHTTPStatusCode() int

func (*Context) GetHeader added in v1.1.26

func (c *Context) GetHeader() *OapiHeader

func (*Context) GetRequestID

func (c *Context) GetRequestID() string

func (*Context) Set

func (c *Context) Set(key string, value interface{})

func (*Context) Value

func (c *Context) Value(key interface{}) interface{}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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