session

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Session)

func WithCredentials

func WithCredentials(credentials tos.Credentials) Option

WithCredentials set Credentials

func WithLogger added in v2.2.0

func WithLogger(logger tos.Logger) Option

WithLogger set logger

func WithRegion

func WithRegion(region string) Option

WithRegion set region

func WithTransport

func WithTransport(transport tos.Transport) Option

WithTransport set Transport

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(options ...Option) *Session

NewSession create tos.Client with some same options, example:

 session := NewSession(
		WithRegion(region),
		WithCredentials(tos.NewStaticCredentials(accessKey, secretKey)))
	client, err := session.NewClient(endpoint)

func (*Session) NewClient

func (ss *Session) NewClient(endpoint string, options ...tos.ClientOption) (*tos.Client, error)

NewClient create tos.Client from a Session, example:

client, err := session.NewClient(endpoint)
// or
client, err := session.NewClient(endpoint, someSpecialOptions...)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL