Documentation
¶
Index ¶
- Constants
- Variables
- func NewRequest(method string, options ...Option) (*http.Request, error)
- type AccessToken
- type ClientIdentity
- type Credentials
- type CredentialsReader
- type Option
- func GetWithETag(value string) Option
- func PutWithContent(value io.Reader) Option
- func PutWithContentBytes(value []byte) Option
- func PutWithContentEncoding(value string) Option
- func PutWithContentLength(value int64) Option
- func PutWithContentMD5(value []byte) Option
- func PutWithContentString(value string) Option
- func PutWithContentType(value string) Option
- func PutWithGeneration(value string) Option
- func WithBearerToken(value string) Option
- func WithBucket(value string) Option
- func WithCompositeOption(options ...Option) Option
- func WithConditionalOption(option Option, condition bool) Option
- func WithContext(value context.Context) Option
- func WithCredentials(credentials Credentials) Option
- func WithEndpoint(scheme, host string) Option
- func WithExpiration(value time.Time) Option
- func WithResource(value string) Option
- func WithSignedExpiration(value time.Time) Option
- type PrivateKey
- type ResolverOption
- type TokenResolver
Constants ¶
View Source
const ( GET = "GET" PUT = "PUT" HEAD = "HEAD" )
Variables ¶
View Source
var ( ErrMalformedPrivateKey = errors.New("malformed private key") ErrUnsupportedPrivateKey = errors.New("unsupported private key type") ErrMalformedJSON = errors.New("malformed JSON") )
View Source
var ( ErrHTTPMethodMissing = errors.New("missing HTTP method") ErrHTTPMethodUnrecognized = errors.New("unrecognized HTTP method") ErrBucketMissing = errors.New("bucket is required") ErrResourceMissing = errors.New("object resource key is required") ErrContentMissing = errors.New("content payload is required") )
View Source
var CredentialOptions credentialSingleton
View Source
var ErrCredentialsFailure = errors.New("unable to discover credentials")
View Source
var ErrFailedTokenRequest = errors.New("unable to resolve access token")
Functions ¶
Types ¶
type AccessToken ¶
type ClientIdentity ¶
type Credentials ¶
type Credentials struct { BearerToken string AccessID string PrivateKey PrivateKey }
func NewCredentials ¶
func NewCredentials(accessID string, privateKey []byte) (Credentials, error)
func ParseCredentialsFromJSON ¶
func ParseCredentialsFromJSON(raw []byte, options ...ResolverOption) (Credentials, error)
type CredentialsReader ¶
type CredentialsReader interface {
Read(context.Context, string) (Credentials, error)
}
func NewCredentialsReader ¶
func NewCredentialsReader(options ...credentialOption) CredentialsReader
type Option ¶
type Option func(*model)
func GetWithETag ¶
func PutWithContent ¶
func PutWithContentBytes ¶
func PutWithContentEncoding ¶
func PutWithContentLength ¶
func PutWithContentMD5 ¶
func PutWithContentString ¶
func PutWithContentType ¶
func PutWithGeneration ¶
func WithBucket ¶
func WithCompositeOption ¶
func WithConditionalOption ¶
func WithContext ¶
func WithCredentials ¶
func WithCredentials(credentials Credentials) Option
func WithEndpoint ¶
func WithResource ¶
func WithSignedExpiration ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
type ResolverOption ¶
type ResolverOption func(this *defaultResolver)
func WithResolverClient ¶
func WithResolverClient(value httpClient) ResolverOption
func WithResolverContext ¶
func WithResolverContext(value context.Context) ResolverOption
type TokenResolver ¶
type TokenResolver interface {
AccessToken(ClientIdentity) (AccessToken, error)
}
Click to show internal directories.
Click to hide internal directories.