Documentation ¶
Index ¶
- Constants
- Variables
- func AmazonTraceIDGen() string
- func ConvertByteToFile(fileByte io.Writer, writer *bytes.Buffer, fileName string) (runtime.NamedReadCloser, error)
- func CustomTransportRuntime(transport *httptransport.Runtime) *httptransport.Runtime
- func EscapeQuotes(s string) string
- func GenerateID() string
- func GenerateMessageID() string
- func GetRequestBuffer(r *ABRequest) []byte
- func IsFormType(r *ABRequest) bool
- func IsMultipart(r *ABRequest, mediaType string) bool
- func IsStatusCodeError(statusCode int) bool
- func LogRequest(r *http.Request) interface{}
- func LogResponse(r *http.Response) interface{}
- func MangleContentType(mediaType, boundary string) string
- func NewHttpRequestFromABRequest(req *ABRequest, mediaType string, basePath string, ...) (*http.Request, error)
- func ReadByChunks(filePath string) (*os.File, error)
- func RewindBody(r *http.Request) (*http.Request, error)
- func SelectScheme(schemes []string) string
- func SetLogger(inner http.RoundTripper) http.RoundTripper
- func SetTimeNowForTest(t *testing.T, now time.Time)
- func SetupRewindBody(r *http.Request) (*http.Request, error)
- func TimeNow() time.Time
- func UserAgentGen() string
- type ABClientTransport
- func (ct *ABClientTransport) GetPreSendABRequestFunc() PreSendABRequestFunc
- func (ct *ABClientTransport) GetPreSendHttpRequestFunc() PreSendHttpRequestFunc
- func (ct *ABClientTransport) GetRoundTripper() http.RoundTripper
- func (ct *ABClientTransport) NewHttpClient() *http.Client
- func (ct *ABClientTransport) PickScheme(schemes []string) string
- func (ct *ABClientTransport) SetPreSendABequestFunc(requestFunc PreSendABRequestFunc) error
- func (ct *ABClientTransport) SetPreSendHttpRequestFunc(requestFunc PreSendHttpRequestFunc) error
- func (ct *ABClientTransport) Submit(clientOperation *oar.ClientOperation) (interface{}, error)
- type ABRequest
- func (r *ABRequest) GetBody() []byte
- func (r *ABRequest) GetBodyParam() interface{}
- func (r *ABRequest) GetFileParam() map[string][]oar.NamedReadCloser
- func (r *ABRequest) GetHeaderParams() http.Header
- func (r *ABRequest) GetMethod() string
- func (r *ABRequest) GetPath() string
- func (r *ABRequest) GetQueryParams() url.Values
- func (r *ABRequest) SetBodyParam(payload interface{}) error
- func (r *ABRequest) SetFileParam(name string, files ...oar.NamedReadCloser) error
- func (r *ABRequest) SetFormParam(name string, values ...string) error
- func (r *ABRequest) SetHeaderParam(name string, values ...string) error
- func (r *ABRequest) SetPathParam(name string, value string) error
- func (r *ABRequest) SetQueryParam(name string, values ...string) error
- func (r *ABRequest) SetTimeout(timeout time.Duration) error
- type ABResponse
- type Backoff
- type ClientTransport
- type CodeVerifier
- type CustomTransport
- type DefaultPersistentRoundTripper
- type Once
- type PersistentRoundTripper
- type PreSendABRequestFunc
- type PreSendHttpRequestFunc
- type Retry
- type TrackedReadCloser
Constants ¶
View Source
const ( DefaultLength = 32 MinLength = 32 MaxLength = 96 )
View Source
const ( StartBackoff = 1 * time.Second MaxBackoff = 5 * time.Second MaxTries = 1 )
View Source
const (
HeaderContentDisposition = "Content-Disposition"
)
View Source
const UserAgentSDK = "AccelByteGoSDK/v0.40.0"
UserAgentSDK attention: this var will be incremented automatically on `Makefile version` using regex therefore the patterns need to comply
Variables ¶
View Source
var (
DefaultTimeout = 30 * time.Second
)
Functions ¶
func AmazonTraceIDGen ¶ added in v0.16.0
func AmazonTraceIDGen() string
func ConvertByteToFile ¶ added in v0.30.0
func CustomTransportRuntime ¶ added in v0.30.0
func CustomTransportRuntime(transport *httptransport.Runtime) *httptransport.Runtime
func EscapeQuotes ¶ added in v0.21.0
func GenerateMessageID ¶
func GenerateMessageID() string
func GetRequestBuffer ¶ added in v0.21.0
func IsFormType ¶ added in v0.21.0
func IsMultipart ¶ added in v0.21.0
func IsStatusCodeError ¶ added in v0.21.0
func LogRequest ¶ added in v0.22.0
func LogResponse ¶ added in v0.22.0
func MangleContentType ¶ added in v0.21.0
func NewHttpRequestFromABRequest ¶ added in v0.21.0
func SelectScheme ¶ added in v0.21.0
func SetLogger ¶ added in v0.22.0
func SetLogger(inner http.RoundTripper) http.RoundTripper
func SetupRewindBody ¶ added in v0.21.0
func UserAgentGen ¶ added in v0.13.0
func UserAgentGen() string
Types ¶
type ABClientTransport ¶ added in v0.21.0
type ABClientTransport struct { DefaultMediaType string DefaultAuthentication oar.ClientAuthInfoWriter Consumers map[string]oar.Consumer Producers map[string]oar.Producer Transport http.RoundTripper Jar http.CookieJar Host string BasePath string Schemes []string Formats oaStrFmt.Registry Context context.Context Debug bool Logger oarLogger.Logger // contains filtered or unexported fields }
ABClientTransport Implements utils.ClientTransport
func NewABClientTransport ¶ added in v0.21.0
func NewABClientTransport(host, basePath string, schemes []string) *ABClientTransport
func NewABClientTransportWithHttpClient ¶ added in v0.21.0
func NewABClientTransportWithHttpClient(host, basePath string, schemes []string, httpClient *http.Client) *ABClientTransport
func (*ABClientTransport) GetPreSendABRequestFunc ¶ added in v0.21.0
func (ct *ABClientTransport) GetPreSendABRequestFunc() PreSendABRequestFunc
func (*ABClientTransport) GetPreSendHttpRequestFunc ¶ added in v0.21.0
func (ct *ABClientTransport) GetPreSendHttpRequestFunc() PreSendHttpRequestFunc
func (*ABClientTransport) GetRoundTripper ¶ added in v0.21.0
func (ct *ABClientTransport) GetRoundTripper() http.RoundTripper
func (*ABClientTransport) NewHttpClient ¶ added in v0.21.0
func (ct *ABClientTransport) NewHttpClient() *http.Client
func (*ABClientTransport) PickScheme ¶ added in v0.21.0
func (ct *ABClientTransport) PickScheme(schemes []string) string
func (*ABClientTransport) SetPreSendABequestFunc ¶ added in v0.21.0
func (ct *ABClientTransport) SetPreSendABequestFunc(requestFunc PreSendABRequestFunc) error
func (*ABClientTransport) SetPreSendHttpRequestFunc ¶ added in v0.21.0
func (ct *ABClientTransport) SetPreSendHttpRequestFunc(requestFunc PreSendHttpRequestFunc) error
func (*ABClientTransport) Submit ¶ added in v0.21.0
func (ct *ABClientTransport) Submit(clientOperation *oar.ClientOperation) (interface{}, error)
type ABRequest ¶ added in v0.21.0
type ABRequest struct { PathPattern string Method string Writer oar.ClientRequestWriter PathParams map[string]string Header http.Header Query url.Values FormFields url.Values FileFields map[string][]oar.NamedReadCloser Payload interface{} Timeout time.Duration Buf *bytes.Buffer GetBodyFunc func(r *ABRequest) []byte }
ABRequest Implements runtime.ClientRequest
func NewABRequestFromClientOperation ¶ added in v0.21.0
func NewABRequestFromClientOperation(clientOperation *oar.ClientOperation) (*ABRequest, error)
func (*ABRequest) GetBodyParam ¶ added in v0.21.0
func (r *ABRequest) GetBodyParam() interface{}
func (*ABRequest) GetFileParam ¶ added in v0.21.0
func (r *ABRequest) GetFileParam() map[string][]oar.NamedReadCloser
func (*ABRequest) GetHeaderParams ¶ added in v0.21.0
func (*ABRequest) GetQueryParams ¶ added in v0.21.0
func (*ABRequest) SetBodyParam ¶ added in v0.21.0
func (*ABRequest) SetFileParam ¶ added in v0.21.0
func (r *ABRequest) SetFileParam(name string, files ...oar.NamedReadCloser) error
func (*ABRequest) SetFormParam ¶ added in v0.21.0
func (*ABRequest) SetHeaderParam ¶ added in v0.21.0
func (*ABRequest) SetPathParam ¶ added in v0.21.0
func (*ABRequest) SetQueryParam ¶ added in v0.21.0
type ABResponse ¶ added in v0.21.0
type ABResponse struct {
// contains filtered or unexported fields
}
ABResponse Implements runtime.ClientResponse
func NewABResponseFromHttpResponse ¶ added in v0.21.0
func NewABResponseFromHttpResponse(httpResponse *http.Response) ABResponse
func (ABResponse) Body ¶ added in v0.21.0
func (r ABResponse) Body() io.ReadCloser
func (ABResponse) Code ¶ added in v0.21.0
func (r ABResponse) Code() int
func (ABResponse) GetHeader ¶ added in v0.21.0
func (r ABResponse) GetHeader(name string) string
func (ABResponse) Message ¶ added in v0.21.0
func (r ABResponse) Message() string
type ClientTransport ¶ added in v0.21.0
type ClientTransport interface { GetRoundTripper() http.RoundTripper GetPreSendABRequestFunc() PreSendABRequestFunc SetPreSendABRequestFunc(PreSendABRequestFunc) error GetPreSendHttpRequestFunc() PreSendHttpRequestFunc SetPreSendHttpRequestFunc(PreSendHttpRequestFunc) error oar.ClientTransport // for Submit(*ClientOperation) (interface{}, error) }
ClientTransport Implements runtime.ClientTransport
type CodeVerifier ¶
type CodeVerifier struct {
Value string
}
func CreateCodeVerifier ¶
func CreateCodeVerifier() (*CodeVerifier, error)
func CreateCodeVerifierFromBytes ¶
func CreateCodeVerifierFromBytes(b []byte) (*CodeVerifier, error)
func CreateCodeVerifierWithLength ¶
func CreateCodeVerifierWithLength(length int) (*CodeVerifier, error)
func (*CodeVerifier) CodeChallengePlain ¶
func (v *CodeVerifier) CodeChallengePlain() string
func (*CodeVerifier) CodeChallengeS256 ¶
func (v *CodeVerifier) CodeChallengeS256() string
func (*CodeVerifier) String ¶
func (v *CodeVerifier) String() string
type CustomTransport ¶ added in v0.18.0
type CustomTransport struct {
// contains filtered or unexported fields
}
type DefaultPersistentRoundTripper ¶ added in v0.21.0
type DefaultPersistentRoundTripper struct { MaxAttempts *int MaxElapsed *time.Duration // contains filtered or unexported fields }
func NewDefaultPersistentRoundTripper ¶ added in v0.21.0
func NewDefaultPersistentRoundTripper(maxAttempts *int, maxElapsed *time.Duration, internalRoundTripper http.RoundTripper) DefaultPersistentRoundTripper
type Once ¶ added in v0.23.0
type Once struct {
// contains filtered or unexported fields
}
func (*Once) Do ¶ added in v0.23.0
func (o *Once) Do(f func())
This Do is similar to http://github.com/matryer/resync
func (*Once) Reset ¶ added in v0.23.0
func (o *Once) Reset()
This Reset is similar to http://github.com/matryer/resync
type PersistentRoundTripper ¶ added in v0.21.0
type PreSendABRequestFunc ¶ added in v0.21.0
type PreSendHttpRequestFunc ¶ added in v0.21.0
type Retry ¶ added in v0.19.0
type Retry struct { RetryCodes map[int]bool MaxTries uint Backoff Backoff Transport http.RoundTripper Sleeper func(duration time.Duration) }
Retry struct with http.RoundTripper.
type TrackedReadCloser ¶ added in v0.21.0
type TrackedReadCloser struct { io.ReadCloser // contains filtered or unexported fields }
func (*TrackedReadCloser) Close ¶ added in v0.21.0
func (r *TrackedReadCloser) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.