Documentation ¶
Index ¶
- Constants
- Variables
- func CtxWithCredentials(ctx context.Context, creds *SwiftCreds) context.Context
- func CtxWithRegion(ctx context.Context, region string) context.Context
- func CtxWithTimeout(ctx context.Context, timeout time.Duration) context.Context
- func GetSwiftRegion() string
- func RegionFromCtx(ctx context.Context) (string, bool)
- func RegisterDefaultDriver()
- func TimeoutFromCtx(ctx context.Context) (*time.Duration, bool)
- type Driver
- func (d *Driver) Create(ctx context.Context, url string) (driver.ObjectWriter, error)
- func (d *Driver) Name() string
- func (d *Driver) Open(ctx context.Context, url string, size int64) (driver.Object, error)
- func (d *Driver) Readdir(ctx context.Context, url string) ([]os.FileInfo, error)
- func (d *Driver) Remove(ctx context.Context, url string) error
- func (d *Driver) Stat(ctx context.Context, url string) (os.FileInfo, error)
- type SwiftCreds
- type SwiftCtxProvider
- type SwiftEnvProvider
Constants ¶
View Source
const ( SwiftCtxProviderName = "SwiftCtxProvider" SwiftEnvProviderName = "SwiftEnvProvider" )
View Source
const ( SwiftAccessKeyId = "SWIFT_ACCESS_KEY_ID" SwiftSecretAccessKey = "SWIFT_SECRET_ACCESS_KEY" )
View Source
const DefaultRegion = "us-east-1"
Variables ¶
View Source
var ( ErrSwiftAccessKeyIDNotFound = fmt.Errorf("%s not found in environment", SwiftAccessKeyId) ErrSwiftSecretAccessKeyNotFound = fmt.Errorf("%s not found in environment", SwiftSecretAccessKey) )
Functions ¶
func CtxWithCredentials ¶
func CtxWithCredentials(ctx context.Context, creds *SwiftCreds) context.Context
func CtxWithTimeout ¶
func GetSwiftRegion ¶
func GetSwiftRegion() string
func RegisterDefaultDriver ¶
func RegisterDefaultDriver()
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
type SwiftCreds ¶
func CredentialsFromCtx ¶
func CredentialsFromCtx(ctx context.Context) (*SwiftCreds, bool)
type SwiftCtxProvider ¶
type SwiftCtxProvider struct {
// contains filtered or unexported fields
}
func NewSwiftCtxProvider ¶
func NewSwiftCtxProvider(account string, creds *SwiftCreds) *SwiftCtxProvider
func (*SwiftCtxProvider) IsExpired ¶
func (e *SwiftCtxProvider) IsExpired() bool
func (*SwiftCtxProvider) Retrieve ¶
func (e *SwiftCtxProvider) Retrieve() (credentials.Value, error)
type SwiftEnvProvider ¶
type SwiftEnvProvider struct {
// contains filtered or unexported fields
}
func NewSwiftEnvProvider ¶
func NewSwiftEnvProvider(account string) *SwiftEnvProvider
func (*SwiftEnvProvider) IsExpired ¶
func (e *SwiftEnvProvider) IsExpired() bool
func (*SwiftEnvProvider) Retrieve ¶
func (e *SwiftEnvProvider) Retrieve() (credentials.Value, error)
Click to show internal directories.
Click to hide internal directories.