Documentation
¶
Index ¶
- type AccessTokenType
- type File
- func (f *File) ContentStream() io.Reader
- func (f *File) IsStream() bool
- func (f *File) MIMEHeader() textproto.MIMEHeader
- func (f *File) Name() string
- func (f *File) Read(p []byte) (n int, err error)
- func (f *File) SetContent(content []byte) *File
- func (f *File) SetContentStream(reader io.Reader) *File
- func (f *File) SetName(name string) *File
- func (f *File) SetType(typ string) *File
- func (f *File) Type() string
- type FormData
- type Info
- type Opt
- type OptFn
- type Request
- func NewRequest(httpPath, httpMethod string, accessTokenTypes []AccessTokenType, ...) *Request
- func NewRequest2(httpPath, httpMethod string, accessTokenType AccessTokenType, ...) *Request
- func NewRequestByAuth(httpPath, httpMethod string, input, output interface{}) *Request
- func NewRequestWithNative(httpPath, httpMethod string, accessTokenType AccessTokenType, ...) *Request
- type UserID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenType ¶
type AccessTokenType string
const ( AccessTokenTypeNone AccessTokenType = "none_access_token" AccessTokenTypeApp AccessTokenType = "app_access_token" AccessTokenTypeTenant AccessTokenType = "tenant_access_token" AccessTokenTypeUser AccessTokenType = "user_access_token" )
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) ContentStream ¶
func (*File) MIMEHeader ¶
func (f *File) MIMEHeader() textproto.MIMEHeader
func (*File) SetContent ¶
type FormData ¶
type FormData struct {
// contains filtered or unexported fields
}
func NewFormData ¶
func NewFormData() *FormData
type Info ¶
type Info struct { HttpPath string // request http path HttpMethod string // request http method QueryParams string // request query Input interface{} // request body AccessibleTokenTypeSet map[AccessTokenType]struct{} // request accessible token type AccessTokenType AccessTokenType // request access token type TenantKey string UserAccessToken string // user access token UserID *UserID IsNotDataField bool // response body is not data field Output interface{} // response body data Retryable bool IsResponseStream bool IsResponseStreamReal bool // contains filtered or unexported fields }
func GetInfoByCtx ¶
func (*Info) WithContext ¶
type OptFn ¶
type OptFn func(*Opt)
func SetNotDataField ¶ added in v1.0.2
func SetNotDataField() OptFn
func SetPathParams ¶
func SetQueryParams ¶
func SetResponseStream ¶ added in v1.0.2
func SetResponseStream() OptFn
func SetTenantKey ¶
func SetUserAccessToken ¶
type Request ¶
type Request struct { *Info HTTPRequest *http.Request HTTPResponse *http.Response RequestBody []byte RequestBodyStream io.Reader RequestBodyFilePath string ContentType string Err error }
func NewRequest ¶
func NewRequest(httpPath, httpMethod string, accessTokenTypes []AccessTokenType, input interface{}, output interface{}, optFns ...OptFn) *Request
func NewRequest2 ¶
func NewRequest2(httpPath, httpMethod string, accessTokenType AccessTokenType, input interface{}, output interface{}, optFns ...OptFn) *Request
Deprecated, please use `NewRequestWithNative`
func NewRequestByAuth ¶
func NewRequestWithNative ¶ added in v1.1.10
func NewRequestWithNative(httpPath, httpMethod string, accessTokenType AccessTokenType, input interface{}, output interface{}, optFns ...OptFn) *Request
func (*Request) DataFilled ¶
type UserID ¶
type UserID struct { Type constants.UserIDType ID string }
Click to show internal directories.
Click to hide internal directories.