Documentation
¶
Index ¶
- Variables
- func GetExpandFields(fieldIds ...string) string
- func GetJwt(key Key, iss string, sub string, aud string, scopes []string, expiresIn int64) (string, error)
- func GetRsa256Key(privateKeyFilePath string) rsa256Key
- func GetRsa256KeyFromPEMBytes(privateKeyBytes []byte) rsa256Key
- func GetRsa256KeyFromPEMString(privateKeyString string) rsa256Key
- type ApiError
- type ApiErrorImpl
- func (e *ApiErrorImpl) Error() string
- func (e *ApiErrorImpl) GetDescription() string
- func (e *ApiErrorImpl) GetMissingScopes() []string
- func (e *ApiErrorImpl) GetStatusCode() int
- func (e *ApiErrorImpl) HasToRequestScopes() bool
- func (e *ApiErrorImpl) IsMissingScopes() bool
- func (e *ApiErrorImpl) RequestScopesUrl() string
- func (e *ApiErrorImpl) Unwrap() error
- type ClientOption
- type ClientOptions
- type ClientOptionsImpl
- func (co *ClientOptionsImpl) GetAudience() string
- func (co *ClientOptionsImpl) GetBasePath() string
- func (co *ClientOptionsImpl) GetHost() string
- func (co *ClientOptionsImpl) GetProtocol() string
- func (co *ClientOptionsImpl) GetUrl() string
- func (co *ClientOptionsImpl) SetAudience(value string) ClientOptions
- func (co *ClientOptionsImpl) SetBasePath(value string) ClientOptions
- func (co *ClientOptionsImpl) SetHost(value string) ClientOptions
- func (co *ClientOptionsImpl) SetProtocol(value string) ClientOptions
- func (co *ClientOptionsImpl) SetUrl(value string) ClientOptions
- type ErrorObject
- type File
- type HttpClient
- type HttpClientImpl
- func (hc *HttpClientImpl) Get(res interface{}, url string, opts ...RequestOption) error
- func (hc *HttpClientImpl) Post(res interface{}, url string, payload interface{}, opts ...RequestOption) error
- func (hc *HttpClientImpl) PostWithFiles(res interface{}, url string, payload interface{}, files []File, ...) error
- func (hc *HttpClientImpl) Request(res interface{}, requestMethod string, url string, opts ...RequestOption) error
- func (hc *HttpClientImpl) SetRequester(requester HttpClientRequester)
- type HttpClientRequester
- type HttpReqFuncType
- type Impersonation
- type ImpersonationImpl
- func (imp *ImpersonationImpl) GetAccessToken() string
- func (imp *ImpersonationImpl) GetAccessTokenExpires() time.Time
- func (imp *ImpersonationImpl) GetScopes() []string
- func (imp *ImpersonationImpl) GetSub() string
- func (imp *ImpersonationImpl) SetAccessToken(value string) Impersonation
- func (imp *ImpersonationImpl) SetAccessTokenExpires(value time.Time) Impersonation
- func (imp *ImpersonationImpl) SetScopes(value []string) Impersonation
- func (imp *ImpersonationImpl) SetSub(value string) Impersonation
- type Key
- type PageParams
- type PageParamsImpl
- type QueryParams
- type Request
- type RequestOption
- func WithExpand(paths ...string) RequestOption
- func WithHeader(name string, value string) RequestOption
- func WithPage(pageParams PageParams) RequestOption
- func WithPageParams(limit int, startingAfter string) RequestOption
- func WithQueryParam(qParam string, value string) RequestOption
- func WithQueryParamList(qParam string, values ...string) RequestOption
- func WithReqOptQueryParamList(name string, values []string) RequestOption
- func WithRequestHost(host string) RequestOption
- func WithUpdatedAfter(ts int) RequestOption
- type RequestOptions
- type RequestOptionsImpl
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ApiErrorHttpRequestMethod = "Error while initializing http request" ApiErrorHttpBodyResponse = "Error reading body response" ApiErrorHttpRequest = "Error when sending http request to Glide API" ApiErrorHttpReadResponse = "Error while reading response body" )
Functions ¶
func GetExpandFields ¶
func GetRsa256Key ¶
func GetRsa256Key(privateKeyFilePath string) rsa256Key
func GetRsa256KeyFromPEMBytes ¶
func GetRsa256KeyFromPEMBytes(privateKeyBytes []byte) rsa256Key
func GetRsa256KeyFromPEMString ¶
func GetRsa256KeyFromPEMString(privateKeyString string) rsa256Key
Types ¶
type ApiErrorImpl ¶
type ApiErrorImpl struct { Description string StatusCode int ResponseHeaders http.Header Params map[string]interface{} Err error }
func GetApiError ¶
func GetApiError(e error) *ApiErrorImpl
func NewApiErrorWithArgs ¶
func NewHttpMethodApiError ¶
func NewHttpMethodApiError(e error) *ApiErrorImpl
func NewHttpRequestApiError ¶
func NewHttpRequestApiError(e error) *ApiErrorImpl
func (*ApiErrorImpl) Error ¶
func (e *ApiErrorImpl) Error() string
func (*ApiErrorImpl) GetDescription ¶
func (e *ApiErrorImpl) GetDescription() string
func (*ApiErrorImpl) GetMissingScopes ¶
func (e *ApiErrorImpl) GetMissingScopes() []string
func (*ApiErrorImpl) GetStatusCode ¶
func (e *ApiErrorImpl) GetStatusCode() int
func (*ApiErrorImpl) HasToRequestScopes ¶
func (e *ApiErrorImpl) HasToRequestScopes() bool
func (*ApiErrorImpl) IsMissingScopes ¶
func (e *ApiErrorImpl) IsMissingScopes() bool
func (*ApiErrorImpl) RequestScopesUrl ¶
func (e *ApiErrorImpl) RequestScopesUrl() string
func (*ApiErrorImpl) Unwrap ¶
func (e *ApiErrorImpl) Unwrap() error
type ClientOption ¶
type ClientOption func(options ClientOptions)
func WithAudience ¶
func WithAudience(audience string) ClientOption
func WithBasePath ¶
func WithBasePath(basePath string) ClientOption
func WithHost ¶
func WithHost(host string) ClientOption
func WithProtocol ¶
func WithProtocol(protocol string) ClientOption
func WithURL ¶
func WithURL(URL string) ClientOption
type ClientOptions ¶
type ClientOptions interface { GetProtocol() string GetHost() string GetUrl() string GetBasePath() string GetAudience() string SetProtocol(value string) ClientOptions SetHost(value string) ClientOptions SetUrl(value string) ClientOptions SetBasePath(value string) ClientOptions SetAudience(value string) ClientOptions }
func NewClientOptions ¶
func NewClientOptions() ClientOptions
type ClientOptionsImpl ¶
type ClientOptionsImpl struct {
// contains filtered or unexported fields
}
func (*ClientOptionsImpl) GetAudience ¶
func (co *ClientOptionsImpl) GetAudience() string
func (*ClientOptionsImpl) GetBasePath ¶
func (co *ClientOptionsImpl) GetBasePath() string
func (*ClientOptionsImpl) GetHost ¶
func (co *ClientOptionsImpl) GetHost() string
func (*ClientOptionsImpl) GetProtocol ¶
func (co *ClientOptionsImpl) GetProtocol() string
func (*ClientOptionsImpl) GetUrl ¶
func (co *ClientOptionsImpl) GetUrl() string
func (*ClientOptionsImpl) SetAudience ¶
func (co *ClientOptionsImpl) SetAudience(value string) ClientOptions
func (*ClientOptionsImpl) SetBasePath ¶
func (co *ClientOptionsImpl) SetBasePath(value string) ClientOptions
func (*ClientOptionsImpl) SetHost ¶
func (co *ClientOptionsImpl) SetHost(value string) ClientOptions
func (*ClientOptionsImpl) SetProtocol ¶
func (co *ClientOptionsImpl) SetProtocol(value string) ClientOptions
func (*ClientOptionsImpl) SetUrl ¶
func (co *ClientOptionsImpl) SetUrl(value string) ClientOptions
type ErrorObject ¶
type HttpClient ¶
type HttpClient interface { Get(res interface{}, url string, opts ...RequestOption) error Post(res interface{}, url string, payload interface{}, opts ...RequestOption) error PostWithFiles(res interface{}, url string, payload interface{}, files []File, opts ...RequestOption) error Request(res interface{}, requestMethod string, url string, opts ...RequestOption) error SetRequester(requester HttpClientRequester) }
func NewHttpClient ¶
func NewHttpClient() HttpClient
func NewHttpClientWithRequester ¶
func NewHttpClientWithRequester(requester HttpClientRequester) HttpClient
type HttpClientImpl ¶
type HttpClientImpl struct {
// contains filtered or unexported fields
}
func (*HttpClientImpl) Get ¶
func (hc *HttpClientImpl) Get(res interface{}, url string, opts ...RequestOption) error
func (*HttpClientImpl) Post ¶
func (hc *HttpClientImpl) Post(res interface{}, url string, payload interface{}, opts ...RequestOption) error
func (*HttpClientImpl) PostWithFiles ¶
func (hc *HttpClientImpl) PostWithFiles(res interface{}, url string, payload interface{}, files []File, opts ...RequestOption) error
func (*HttpClientImpl) Request ¶
func (hc *HttpClientImpl) Request(res interface{}, requestMethod string, url string, opts ...RequestOption) error
func (*HttpClientImpl) SetRequester ¶
func (hc *HttpClientImpl) SetRequester(requester HttpClientRequester)
type HttpClientRequester ¶
type Impersonation ¶
type Impersonation interface { GetSub() string GetScopes() []string GetAccessToken() string GetAccessTokenExpires() time.Time SetSub(string) Impersonation SetScopes([]string) Impersonation SetAccessToken(string) Impersonation SetAccessTokenExpires(time.Time) Impersonation }
func NewImpersonation ¶
func NewImpersonation() Impersonation
type ImpersonationImpl ¶
type ImpersonationImpl struct {
// contains filtered or unexported fields
}
func (*ImpersonationImpl) GetAccessToken ¶
func (imp *ImpersonationImpl) GetAccessToken() string
func (*ImpersonationImpl) GetAccessTokenExpires ¶
func (imp *ImpersonationImpl) GetAccessTokenExpires() time.Time
func (*ImpersonationImpl) GetScopes ¶
func (imp *ImpersonationImpl) GetScopes() []string
func (*ImpersonationImpl) GetSub ¶
func (imp *ImpersonationImpl) GetSub() string
func (*ImpersonationImpl) SetAccessToken ¶
func (imp *ImpersonationImpl) SetAccessToken(value string) Impersonation
func (*ImpersonationImpl) SetAccessTokenExpires ¶
func (imp *ImpersonationImpl) SetAccessTokenExpires(value time.Time) Impersonation
func (*ImpersonationImpl) SetScopes ¶
func (imp *ImpersonationImpl) SetScopes(value []string) Impersonation
func (*ImpersonationImpl) SetSub ¶
func (imp *ImpersonationImpl) SetSub(value string) Impersonation
type Key ¶
type Key interface { GetJwtSigningMethod() jwt.SigningMethod GetDecoded() (crypto.PrivateKey, error) }
type PageParams ¶
func NewPageParamsWith ¶
func NewPageParamsWith(limit int, startingAfter string) PageParams
type PageParamsImpl ¶
func (*PageParamsImpl) GetQueryParams ¶
func (p *PageParamsImpl) GetQueryParams() map[string]string
type QueryParams ¶
type RequestOption ¶
type RequestOption func(requestOptions *RequestOptionsImpl)
func WithExpand ¶
func WithExpand(paths ...string) RequestOption
func WithHeader ¶
func WithHeader(name string, value string) RequestOption
func WithPage ¶
func WithPage(pageParams PageParams) RequestOption
func WithPageParams ¶
func WithPageParams(limit int, startingAfter string) RequestOption
func WithQueryParam ¶
func WithQueryParam(qParam string, value string) RequestOption
func WithQueryParamList ¶
func WithQueryParamList(qParam string, values ...string) RequestOption
func WithReqOptQueryParamList ¶
func WithReqOptQueryParamList(name string, values []string) RequestOption
func WithRequestHost ¶
func WithRequestHost(host string) RequestOption
func WithUpdatedAfter ¶
func WithUpdatedAfter(ts int) RequestOption
type RequestOptions ¶
type RequestOptionsImpl ¶
type RequestOptionsImpl struct {
// contains filtered or unexported fields
}
func (*RequestOptionsImpl) GetHeaders ¶
func (reqOpt *RequestOptionsImpl) GetHeaders() http.Header
func (*RequestOptionsImpl) GetHost ¶
func (reqOpt *RequestOptionsImpl) GetHost() string
func (*RequestOptionsImpl) GetPayload ¶
func (reqOpt *RequestOptionsImpl) GetPayload() *bytes.Buffer
func (*RequestOptionsImpl) GetQParams ¶
func (reqOpt *RequestOptionsImpl) GetQParams() QueryParams
Source Files
¶
Click to show internal directories.
Click to hide internal directories.