http

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented = errors.New("not implemented")
	DefaultSASTTL     = 30 * time.Second
)

Functions

This section is empty.

Types

type BlobSharedAccessSignatureRequest

type BlobSharedAccessSignatureRequest struct {
	BlobName string `json:"blobName"`
}

type BlobSharedAccessSignatureResponse

type BlobSharedAccessSignatureResponse struct {
	CorrelationID string `json:"correlationId"`
	HostName      string `json:"hostName"`
	ContainerName string `json:"containerName"`
	BlobName      string `json:"blobName"`
	SASToken      string `json:"sasToken"`
}

func (*BlobSharedAccessSignatureResponse) SASURI

type ErrorResponse

type ErrorResponse struct {
	Message          string
	ExceptionMessage string
}

type NotifyUploadCompleteRequest

type NotifyUploadCompleteRequest struct {
	IsSuccess         bool   `json:"isSuccess"`
	StatusCode        int    `json:"statusCode"`
	StatusDescription string `json:"statusDescription"`
}

type Transport

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

func New

func New(opts ...TransportOption) *Transport

New returns new Transport transport.

func (*Transport) Close

func (tr *Transport) Close() error

func (*Transport) Connect

func (tr *Transport) Connect(ctx context.Context, creds transport.Credentials) error

func (*Transport) GetBlobSharedAccessSignature

func (tr *Transport) GetBlobSharedAccessSignature(ctx context.Context, blobName string) (string, string, error)

func (*Transport) NotifyUploadComplete

func (tr *Transport) NotifyUploadComplete(ctx context.Context, correlationID string, success bool, statusCode int, statusDescription string) error

func (*Transport) RegisterDirectMethods

func (tr *Transport) RegisterDirectMethods(ctx context.Context, mux transport.MethodDispatcher) error

RegisterDirectMethods is not available in the HTTP transport.

func (*Transport) RetrieveTwinProperties

func (tr *Transport) RetrieveTwinProperties(ctx context.Context) (payload []byte, err error)

RetrieveTwinProperties is not available in the HTTP transport.

func (*Transport) Send

func (tr *Transport) Send(ctx context.Context, msg *common.Message) error

Send is not available in the HTTP transport.

func (*Transport) SetLogger

func (tr *Transport) SetLogger(logger logger.Logger)

func (*Transport) SubscribeEvents

func (tr *Transport) SubscribeEvents(ctx context.Context, mux transport.MessageDispatcher) error

SubscribeEvents is not available in the HTTP transport.

func (*Transport) SubscribeTwinUpdates

func (tr *Transport) SubscribeTwinUpdates(ctx context.Context, mux transport.TwinStateDispatcher) error

SubscribeTwinUpdates is not available in the HTTP transport.

func (*Transport) UpdateTwinProperties

func (tr *Transport) UpdateTwinProperties(ctx context.Context, payload []byte) (version int, err error)

UpdateTwinProperties is not available in the HTTP transport.

func (*Transport) UploadToBlob

func (tr *Transport) UploadToBlob(ctx context.Context, sasURI string, file io.Reader, size int64) error

type TransportOption

type TransportOption func(tr *Transport)

TransportOption is a transport configuration option.

func WithClient

func WithClient(c *http.Client) TransportOption

WithClient sets client to use for HTTP requests.

func WithLogger

func WithLogger(l logger.Logger) TransportOption

WithLogger sets logger for errors and warnings plus debug messages when it's enabled.

func WithTLSConfig

func WithTLSConfig(config *tls.Config) TransportOption

WithTLSConfig sets TLS config that's used by REST HTTP and AMQP clients.

func WithTTL

func WithTTL(ttl time.Duration) TransportOption

WithTTL configures the TTL used for SAS tokens.

Jump to

Keyboard shortcuts

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