Documentation ¶
Index ¶
- Constants
- Variables
- func NewHTTPMetaData() protocol.Metadata
- func WithMapInterface(opt map[string]interface{}) func(client protocol.Client) error
- func WithTLS(config *tls.Config) func(protocol.Client) error
- func WithTransport(transport *http.Transport) func(protocol.Client)
- type Client
- type ClientBuilder
- type Headers
- type Resource
- func (rs *Resource) Call(ctx context.Context, request interface{}) (response interface{}, err error)
- func (rs *Resource) Close() error
- func (rs *Resource) Expire(ctx context.Context) (bool, interface{}, error)
- func (rs *Resource) Length(ctx context.Context) (int64, error)
- func (rs *Resource) Metadata(ctx context.Context) (protocol.Metadata, error)
- func (rs *Resource) Read(ctx context.Context, off int64, size int64) (rc io.ReadCloser, err error)
Constants ¶
View Source
const ( // http protocol name ProtocolHTTPName = "http" // https protocol name ProtocolHTTPSName = "https" )
Variables ¶
View Source
var ( // DefaultTransport is default implementation of http.Transport. DefaultTransport = newDefaultTransport() // DefaultClient is default implementation of Client. DefaultClient = &Client{ client: &http.Client{Transport: DefaultTransport}, transport: DefaultTransport, } )
Functions ¶
func NewHTTPMetaData ¶
NewHTTPMetaData generates an instance of protocol.Metadata.
func WithMapInterface ¶
WithMapInterface allows to set some options by map interface. Supported: key: "tls.config", value: *tls.Config key: "http.transport" value: *http.Transport
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an implementation of protocol.Client for http protocol.
type ClientBuilder ¶
type ClientBuilder struct {
// contains filtered or unexported fields
}
ClientBuilder is an implementation of protocol.ClientBuilder for http protocol.
func (*ClientBuilder) NewProtocolClient ¶
Click to show internal directories.
Click to hide internal directories.