transport

package
v0.0.0-...-4abcc0c Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CdnTransport *httpTransporter
View Source
var DIRECTORY_AUTH_PATH = "/v1/directory/auth"
View Source
var DirectoryTransport *httpTransporter
View Source
var (
	SENDER_CERTIFICATE_PATH = "/v1/certificate/delivery"
)
View Source
var StorageTransport *httpTransporter

Functions

func NewHTTPClient

func NewHTTPClient() *http.Client

func SetupCDNTransporter

func SetupCDNTransporter(cdnUrl string, tel string, password string, userAgent string, proxyServer string)

func SetupDirectoryTransporter

func SetupDirectoryTransporter(Url string, uuid string, password string, userAgent string, proxyServer string)

func SetupStorageTransporter

func SetupStorageTransporter(Url string, uuid string, password string, userAgent string, proxyServer string)

func SetupTransporter

func SetupTransporter(server string,
	uuid string,
	password string,
	userAgent string,
	proxyServer string)

Types

type AuthCredentials

type AuthCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthCredentials holds the credentials for the websocket connection

func GetCredendtails

func GetCredendtails(path string) (*AuthCredentials, error)

func (*AuthCredentials) AsBasic

func (a *AuthCredentials) AsBasic() string

type SenderCertificate

type SenderCertificate struct {
	Certificate []byte `json:"certificate"`
}

func GetSenderCertificate

func GetSenderCertificate() (*SenderCertificate, error)

type Transporter

type Transporter interface {
	Get(url string) (*response, error)
	GetByte(url string) (*response, error)

	Del(url string) (*response, error)
	Put(url string, body []byte, ct string) (*response, error)
	PutWithAuth(url string, body []byte, ct string, auth string) (*response, error)

	PutJSON(url string, body []byte) (*response, error)
	PutBinary(url string, body []byte) (*response, error)
	PutJSONWithAuth(url string, body []byte, auth string) (*response, error)
	PutJSONWithUnidentifiedSender(url string, body []byte, unidentifiedAccessKey []byte) (*response, error)
}
var Transport Transporter

Jump to

Keyboard shortcuts

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