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 DownloadBinary(endpoint, token, filePath string) (*http.Response, error)
- func EscapeQuotes(s string) string
- func GenerateID() string
- func GenerateMessageID() string
- func GetClient() http.Client
- func GetEnv(key, fallback string) string
- func GetNamespaceContextExpirationTime() time.Duration
- func GetRequestBuffer(r *ABRequest) []byte
- func GetRolesExpirationTime() time.Duration
- 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 SimpleHTTPCall(client http.Client, ...) (*http.Response, error)
- func TimeNow() time.Time
- func UploadBinaryFile(url, token, filePath string) (*http.Response, error)
- 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 FlightIdContainer
- 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 ¶
func AmazonTraceIDGen() string
func ConvertByteToFile ¶
func CustomTransportRuntime ¶
func CustomTransportRuntime(transport *httptransport.Runtime) *httptransport.Runtime
func EscapeQuotes ¶
func GenerateMessageID ¶
func GenerateMessageID() string
func GetRequestBuffer ¶
func GetRolesExpirationTime ¶
func IsFormType ¶
func IsMultipart ¶
func IsStatusCodeError ¶
func LogRequest ¶
func LogResponse ¶
func MangleContentType ¶
func SelectScheme ¶
func SetLogger ¶
func SetLogger(inner http.RoundTripper) http.RoundTripper
func SimpleHTTPCall ¶
func UploadBinaryFile ¶
Function to upload a binary file
func UserAgentGen ¶
func UserAgentGen() string
Types ¶
type ABClientTransport ¶
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 ¶
func NewABClientTransport(host, basePath string, schemes []string) *ABClientTransport
func NewABClientTransportWithHttpClient ¶
func NewABClientTransportWithHttpClient(host, basePath string, schemes []string, httpClient *http.Client) *ABClientTransport
func (*ABClientTransport) GetPreSendABRequestFunc ¶
func (ct *ABClientTransport) GetPreSendABRequestFunc() PreSendABRequestFunc
func (*ABClientTransport) GetPreSendHttpRequestFunc ¶
func (ct *ABClientTransport) GetPreSendHttpRequestFunc() PreSendHttpRequestFunc
func (*ABClientTransport) GetRoundTripper ¶
func (ct *ABClientTransport) GetRoundTripper() http.RoundTripper
func (*ABClientTransport) NewHttpClient ¶
func (ct *ABClientTransport) NewHttpClient() *http.Client
func (*ABClientTransport) PickScheme ¶
func (ct *ABClientTransport) PickScheme(schemes []string) string
func (*ABClientTransport) SetPreSendABequestFunc ¶
func (ct *ABClientTransport) SetPreSendABequestFunc(requestFunc PreSendABRequestFunc) error
func (*ABClientTransport) SetPreSendHttpRequestFunc ¶
func (ct *ABClientTransport) SetPreSendHttpRequestFunc(requestFunc PreSendHttpRequestFunc) error
func (*ABClientTransport) Submit ¶
func (ct *ABClientTransport) Submit(clientOperation *oar.ClientOperation) (interface{}, error)
type ABRequest ¶
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 ¶
func NewABRequestFromClientOperation(clientOperation *oar.ClientOperation) (*ABRequest, error)
func (*ABRequest) GetBodyParam ¶
func (r *ABRequest) GetBodyParam() interface{}
func (*ABRequest) GetFileParam ¶
func (r *ABRequest) GetFileParam() map[string][]oar.NamedReadCloser
func (*ABRequest) GetHeaderParams ¶
func (*ABRequest) GetQueryParams ¶
func (*ABRequest) SetBodyParam ¶
func (*ABRequest) SetFileParam ¶
func (r *ABRequest) SetFileParam(name string, files ...oar.NamedReadCloser) error
func (*ABRequest) SetFormParam ¶
func (*ABRequest) SetHeaderParam ¶
func (*ABRequest) SetQueryParam ¶
type ABResponse ¶
type ABResponse struct {
// contains filtered or unexported fields
}
ABResponse Implements runtime.ClientResponse
func NewABResponseFromHttpResponse ¶
func NewABResponseFromHttpResponse(httpResponse *http.Response) ABResponse
func (ABResponse) Body ¶
func (r ABResponse) Body() io.ReadCloser
func (ABResponse) Code ¶
func (r ABResponse) Code() int
func (ABResponse) GetHeader ¶
func (r ABResponse) GetHeader(name string) string
func (ABResponse) GetHeaders ¶
func (r ABResponse) GetHeaders(name string) []string
func (ABResponse) Message ¶
func (r ABResponse) Message() string
type ClientTransport ¶
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 ¶
type CustomTransport struct {
// contains filtered or unexported fields
}
type DefaultPersistentRoundTripper ¶
type DefaultPersistentRoundTripper struct { MaxAttempts *int MaxElapsed *time.Duration // contains filtered or unexported fields }
func NewDefaultPersistentRoundTripper ¶
func NewDefaultPersistentRoundTripper(maxAttempts *int, maxElapsed *time.Duration, internalRoundTripper http.RoundTripper) DefaultPersistentRoundTripper
type FlightIdContainer ¶
type FlightIdContainer struct {
Value string
}
func GetDefaultFlightID ¶
func GetDefaultFlightID() *FlightIdContainer
func (*FlightIdContainer) SetFlightID ¶
func (f *FlightIdContainer) SetFlightID(flightId string)
type Once ¶
type Once struct {
// contains filtered or unexported fields
}
func (*Once) Do ¶
func (o *Once) Do(f func())
This Do is similar to http://github.com/matryer/resync
func (*Once) Reset ¶
func (o *Once) Reset()
This Reset is similar to http://github.com/matryer/resync
type PersistentRoundTripper ¶
type PreSendABRequestFunc ¶
type PreSendHttpRequestFunc ¶
type Retry ¶
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 ¶
type TrackedReadCloser struct { io.ReadCloser // contains filtered or unexported fields }
func (*TrackedReadCloser) Close ¶
func (r *TrackedReadCloser) Close() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.