fastly

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package fastly provides access to the Fastly Compute hostcall ABI.

The TinyGo SDK is modeled in layers. Each layer has a single purpose. This package is the lowest layer, and it's singular purpose is to adapt each Compute hostcall to a function which is basically idiomatic Go.

In support of that purpose, the package defines a few types, e.g. HTTPBody, which model the modules of the hostcalls, and implement corresponding functions as methods on those types. Each hostcall should have a single corresponding Go method or function.

There are also helper types, like Values, which make it easier to interact with the hostcall ABI. But, in general, this package should be kept as small as possible, and all nontrivial work performed at the next layer up, e.g. package fsthttp.

This package is not and should not be user-accessible. All features, capabilities, etc. that should be accessible by users should be made available via separate packages that treat this package as a dependency.

Index

Constants

View Source
const (
	DefaultSmallBufLen  = 128  // default size for "typically-small" values with variable sizes: HTTP methods, header names, tls protocol names, cipher suites
	DefaultMediumBufLen = 1024 // default size for values between small and large, with variable sizes
	DefaultLargeBufLen  = 8192 // default size for "typically-large" values with variable sizes; header values, URLs.
)

Variables

View Source
var (
	RateWindow1s  = RateWindow{/* contains filtered or unexported fields */}
	RateWindow10s = RateWindow{/* contains filtered or unexported fields */}
	RateWindow60s = RateWindow{/* contains filtered or unexported fields */}
)
View Source
var (
	CounterDuration10s = CounterDuration{/* contains filtered or unexported fields */}
	CounterDuration20s = CounterDuration{/* contains filtered or unexported fields */}
	CounterDuration30s = CounterDuration{/* contains filtered or unexported fields */}
	CounterDuration40s = CounterDuration{/* contains filtered or unexported fields */}
	CounterDuration50s = CounterDuration{/* contains filtered or unexported fields */}
	CounterDuration60s = CounterDuration{/* contains filtered or unexported fields */}
)

Functions

func BackendExists added in v0.1.7

func BackendExists(name string) (bool, error)

func BackendGetBetweenBytesTimeout added in v0.1.7

func BackendGetBetweenBytesTimeout(name string) (time.Duration, error)

func BackendGetConnectTimeout added in v0.1.7

func BackendGetConnectTimeout(name string) (time.Duration, error)

func BackendGetFirstByteTimeout added in v0.1.7

func BackendGetFirstByteTimeout(name string) (time.Duration, error)

func BackendGetHost added in v0.1.7

func BackendGetHost(name string) (string, error)

func BackendGetOverrideHost added in v0.1.7

func BackendGetOverrideHost(name string) (string, error)

func BackendGetPort added in v0.1.7

func BackendGetPort(name string) (int, error)

func BackendIsDynamic added in v0.1.7

func BackendIsDynamic(name string) (bool, error)

func BackendIsSSL added in v0.1.7

func BackendIsSSL(name string) (bool, error)

func BodyDownstreamGet

func BodyDownstreamGet() (*HTTPRequest, *HTTPBody, error)

func DeviceLookup added in v1.2.0

func DeviceLookup(userAgent string) ([]byte, error)

func DownstreamClientIPAddr

func DownstreamClientIPAddr() (net.IP, error)

func DownstreamServerIPAddr added in v1.3.3

func DownstreamServerIPAddr() (net.IP, error)

func DownstreamTLSCipherOpenSSLName

func DownstreamTLSCipherOpenSSLName() (string, error)

func DownstreamTLSClientHello

func DownstreamTLSClientHello() ([]byte, error)

func DownstreamTLSProtocol

func DownstreamTLSProtocol() (string, error)

func ERLCheckRate added in v1.3.0

func ERLCheckRate(rateCounter, entry string, delta uint32, window RateWindow, limit uint32, penaltyBox string, ttl time.Duration) (bool, error)

func GeoLookup

func GeoLookup(ip net.IP) ([]byte, error)

func GetOriginalHeaderCount

func GetOriginalHeaderCount() (int, error)

func GetVCPUMilliseconds added in v1.3.3

func GetVCPUMilliseconds() (uint64, error)

func HandoffFanout added in v0.1.7

func HandoffFanout(backend string) error

func HandoffWebsocket added in v0.1.7

func HandoffWebsocket(backend string) error

func ParseUserAgent

func ParseUserAgent(userAgent string) (family, major, minor, patch string, err error)

func PenaltyBoxAdd added in v1.3.0

func PenaltyBoxAdd(penaltyBox, entry string, ttl time.Duration) error

func PenaltyBoxHas added in v1.3.0

func PenaltyBoxHas(penaltyBox, entry string) (bool, error)

func PurgeSurrogateKey added in v0.1.4

func PurgeSurrogateKey(surrogateKey string, opts PurgeOptions) error

func RateCounterIncrement added in v1.3.0

func RateCounterIncrement(rateCounter, entry string, delta uint32) error

func RateCounterLookupCount added in v1.3.0

func RateCounterLookupCount(rateCounter, entry string, duration CounterDuration) (uint32, error)

func RateCounterLookupRate added in v1.3.0

func RateCounterLookupRate(rateCounter, entry string, window RateWindow) (uint32, error)

func RegisterDynamicBackend added in v0.1.5

func RegisterDynamicBackend(name string, target string, opts *BackendConfigOptions) error

Types

type AutoDecompressResponseOptions

type AutoDecompressResponseOptions struct {
	Gzip bool
}

AutoDecompressResponseOptions collects the auto decompress response options for the request. See the equivalent DecompressResponseOptions type in package fsthttp for more detailed descriptions of each field.

type BackendConfigOptions added in v0.1.5

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

func (*BackendConfigOptions) BetweenBytesTimeout added in v0.1.5

func (b *BackendConfigOptions) BetweenBytesTimeout(t time.Duration)

func (*BackendConfigOptions) CACert added in v0.1.5

func (b *BackendConfigOptions) CACert(caCert string)

func (*BackendConfigOptions) CertHostname added in v0.1.5

func (b *BackendConfigOptions) CertHostname(certHostname string)

func (*BackendConfigOptions) Ciphers added in v0.1.5

func (b *BackendConfigOptions) Ciphers(ciphers string)

func (*BackendConfigOptions) ClientCert added in v1.3.3

func (b *BackendConfigOptions) ClientCert(certificate string, key *Secret)

func (*BackendConfigOptions) ConnectTimeout added in v0.1.5

func (b *BackendConfigOptions) ConnectTimeout(t time.Duration)

func (*BackendConfigOptions) FirstByteTimeout added in v0.1.5

func (b *BackendConfigOptions) FirstByteTimeout(t time.Duration)

func (*BackendConfigOptions) HTTPKeepaliveTime added in v1.3.3

func (b *BackendConfigOptions) HTTPKeepaliveTime(t time.Duration)

func (*BackendConfigOptions) HostOverride added in v0.1.5

func (b *BackendConfigOptions) HostOverride(host string)

func (*BackendConfigOptions) PoolConnections added in v1.3.3

func (b *BackendConfigOptions) PoolConnections(poolingOn bool)

func (*BackendConfigOptions) SNIHostname added in v0.1.5

func (b *BackendConfigOptions) SNIHostname(sniHostname string)

func (*BackendConfigOptions) SSLMaxVersion added in v0.1.5

func (b *BackendConfigOptions) SSLMaxVersion(v TLSVersion)

func (*BackendConfigOptions) SSLMinVersion added in v0.1.5

func (b *BackendConfigOptions) SSLMinVersion(v TLSVersion)

func (*BackendConfigOptions) TCPKeepaliveEnable added in v1.3.3

func (b *BackendConfigOptions) TCPKeepaliveEnable(v bool)

func (*BackendConfigOptions) TCPKeepaliveInterval added in v1.3.3

func (b *BackendConfigOptions) TCPKeepaliveInterval(t time.Duration)

func (*BackendConfigOptions) TCPKeepaliveProbes added in v1.3.3

func (b *BackendConfigOptions) TCPKeepaliveProbes(count uint32)

func (*BackendConfigOptions) TCPKeepaliveTime added in v1.3.3

func (b *BackendConfigOptions) TCPKeepaliveTime(t time.Duration)

func (*BackendConfigOptions) UseGRPC added in v1.3.3

func (b *BackendConfigOptions) UseGRPC(v bool)

func (*BackendConfigOptions) UseSSL added in v0.1.5

func (b *BackendConfigOptions) UseSSL(v bool)

type BackendHealth added in v0.1.7

type BackendHealth prim.U32

witx:

(typename $backend_health
    (enum (@witx tag u32)
        $unknown
        $healthy
        $unhealthy))
const (
	BackendHealthUnknown   BackendHealth = 0
	BackendHealthHealthy   BackendHealth = 1
	BackendHealthUnhealthy BackendHealth = 2
)

func BackendIsHealthy added in v0.1.7

func BackendIsHealthy(name string) (BackendHealth, error)

type CacheEntry added in v0.1.4

type CacheEntry struct{}

func CacheLookup added in v0.1.4

func CacheLookup(key []byte, opts CacheLookupOptions) (*CacheEntry, error)

func CacheTransactionLookup added in v0.1.4

func CacheTransactionLookup(key []byte, opts CacheLookupOptions) (*CacheEntry, error)

func (*CacheEntry) Age added in v0.1.4

func (c *CacheEntry) Age() (time.Duration, error)

func (*CacheEntry) Body added in v0.1.4

func (c *CacheEntry) Body(opts CacheGetBodyOptions) (*HTTPBody, error)

func (*CacheEntry) Cancel added in v0.1.4

func (e *CacheEntry) Cancel() error

func (*CacheEntry) Close added in v0.1.4

func (c *CacheEntry) Close() error

func (*CacheEntry) Hits added in v0.1.4

func (c *CacheEntry) Hits() (uint64, error)

func (*CacheEntry) Insert added in v0.1.4

func (e *CacheEntry) Insert(opts CacheWriteOptions) (*HTTPBody, error)

func (*CacheEntry) InsertAndStreamBack added in v0.1.4

func (e *CacheEntry) InsertAndStreamBack(opts CacheWriteOptions) (*HTTPBody, *CacheEntry, error)

func (*CacheEntry) Length added in v0.1.4

func (c *CacheEntry) Length() (uint64, error)

func (*CacheEntry) MaxAge added in v0.1.4

func (c *CacheEntry) MaxAge() (time.Duration, error)

func (*CacheEntry) StaleWhileRevalidate added in v0.1.4

func (c *CacheEntry) StaleWhileRevalidate() (time.Duration, error)

func (*CacheEntry) State added in v0.1.4

func (c *CacheEntry) State() (CacheLookupState, error)

func (*CacheEntry) Update added in v0.1.4

func (e *CacheEntry) Update(opts CacheWriteOptions) error

func (*CacheEntry) UserMetadata added in v0.1.4

func (c *CacheEntry) UserMetadata() ([]byte, error)

type CacheGetBodyOptions added in v0.1.4

type CacheGetBodyOptions struct{}

func (*CacheGetBodyOptions) From added in v0.1.4

func (o *CacheGetBodyOptions) From(from uint64) error

func (*CacheGetBodyOptions) To added in v0.1.4

func (o *CacheGetBodyOptions) To(to uint64) error

type CacheLookupOptions added in v0.1.4

type CacheLookupOptions struct{}

func (*CacheLookupOptions) SetRequest added in v0.1.4

func (o *CacheLookupOptions) SetRequest(req *HTTPRequest) error

type CacheLookupState added in v0.1.4

type CacheLookupState prim.U32

witx:

;;; The status of this lookup (and potential transaction)
(typename $cache_lookup_state
    (flags (@witx repr u32)
        $found ;; a cached object was found
        $usable ;; the cached object is valid to use (implies $found)
        $stale ;; the cached object is stale (but may or may not be valid to use)
        $must_insert_or_update ;; this client is requested to insert or revalidate an object
    )
)
const (
	CacheLookupStateFound              CacheLookupState = 0b0000_0001 // $found
	CacheLookupStateUsable             CacheLookupState = 0b0000_0010 // $usable
	CacheLookupStateStale              CacheLookupState = 0b0000_0100 // $stale
	CacheLookupStateMustInsertOrUpdate CacheLookupState = 0b0000_1000 // $must_insert_or_update
)

type CacheOverrideOptions

type CacheOverrideOptions struct {
	Pass                 bool
	PCI                  bool
	TTL                  uint32 // seconds
	StaleWhileRevalidate uint32 // seconds
	SurrogateKey         string
}

CacheOverrideOptions collects specific, caching-related options for outbound requests. See the equivalent CacheOverrideOptions type in package fsthttp for more detailed descriptions of each field.

type CacheWriteOptions added in v0.1.4

type CacheWriteOptions struct{}

func (*CacheWriteOptions) ContentLength added in v0.1.4

func (o *CacheWriteOptions) ContentLength(v uint64) error

func (*CacheWriteOptions) InitialAge added in v0.1.4

func (o *CacheWriteOptions) InitialAge(v time.Duration) error

func (*CacheWriteOptions) MaxAge added in v0.1.4

func (o *CacheWriteOptions) MaxAge(v time.Duration) error

func (*CacheWriteOptions) SensitiveData added in v0.1.4

func (o *CacheWriteOptions) SensitiveData(v bool) error

func (*CacheWriteOptions) SetRequest added in v0.1.4

func (o *CacheWriteOptions) SetRequest(req *HTTPRequest) error

func (*CacheWriteOptions) StaleWhileRevalidate added in v0.1.4

func (o *CacheWriteOptions) StaleWhileRevalidate(v time.Duration) error

func (*CacheWriteOptions) SurrogateKeys added in v0.1.4

func (o *CacheWriteOptions) SurrogateKeys(v []string) error

func (*CacheWriteOptions) UserMetadata added in v0.1.4

func (o *CacheWriteOptions) UserMetadata(v []byte) error

func (*CacheWriteOptions) Vary added in v0.1.4

func (o *CacheWriteOptions) Vary(v []string) error

type ConfigStore added in v1.3.3

type ConfigStore struct{}

func OpenConfigStore added in v1.3.3

func OpenConfigStore(name string) (*ConfigStore, error)

func (*ConfigStore) Get added in v1.3.3

func (d *ConfigStore) Get(key string) (string, error)

func (*ConfigStore) GetBytes added in v1.3.3

func (d *ConfigStore) GetBytes(key string) ([]byte, error)

func (*ConfigStore) Has added in v1.3.3

func (d *ConfigStore) Has(key string) (bool, error)

type CounterDuration added in v1.3.0

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

func (CounterDuration) String added in v1.3.0

func (c CounterDuration) String() string

type Dictionary

type Dictionary struct{}

func OpenDictionary

func OpenDictionary(name string) (*Dictionary, error)

func (*Dictionary) Get

func (d *Dictionary) Get(key string) (string, error)

func (*Dictionary) GetBytes added in v1.3.2

func (d *Dictionary) GetBytes(key string) ([]byte, error)

func (*Dictionary) Has added in v1.3.2

func (d *Dictionary) Has(key string) (bool, error)

type FastlyError

type FastlyError struct {
	Status FastlyStatus

	// Detail contains an additional detailed error, if any.
	Detail error
}

FastlyError decorates error-class FastlyStatus values and implements the error interface.

Note that TinyGo currently doesn't support errors.As. Callers can use the IsFastlyError helper instead.

func (FastlyError) Error

func (e FastlyError) Error() string

Error implements the error interface.

type FastlyStatus

type FastlyStatus uint32

FastlyStatus models a response status enum.

const (
	// FastlyStatusOK maps to $fastly_status $ok.
	// TODO(pb): is this the only non-error status?
	FastlyStatusOK FastlyStatus = 0

	// FastlyStatusError maps to $fastly_status $error.
	FastlyStatusError FastlyStatus = 1

	// FastlyStatusInval maps to $fastly_status $inval.
	FastlyStatusInval FastlyStatus = 2

	// FastlyStatusBadf maps to $fastly_status $badf.
	FastlyStatusBadf FastlyStatus = 3

	// FastlyStatusBufLen maps to $fastly_status $buflen.
	FastlyStatusBufLen FastlyStatus = 4

	// FastlyStatusUnsupported maps to $fastly_status $unsupported.
	FastlyStatusUnsupported FastlyStatus = 5

	// FastlyStatusBadAlign maps to $fastly_status $badalign.
	FastlyStatusBadAlign FastlyStatus = 6

	// FastlyStatusHTTPInvalid maps to $fastly_status $httpinvalid.
	FastlyStatusHTTPInvalid FastlyStatus = 7

	// FastlyStatusHTTPUser maps to $fastly_status $httpuser.
	FastlyStatusHTTPUser FastlyStatus = 8

	// FastlyStatusHTTPIncomplete maps to $fastly_status $httpincomplete.
	FastlyStatusHTTPIncomplete FastlyStatus = 9

	// FastlyStatusNone maps to $fastly_status $none.
	FastlyStatusNone FastlyStatus = 10

	// FastlyStatusHTTPHeadTooLarge maps to $fastly_status $httpheadtoolarge.
	FastlyStatusHTTPHeadTooLarge FastlyStatus = 11

	// FastlyStatusHTTPInvalidStatus maps to $fastly_status $httpinvalidstatus.
	FastlyStatusHTTPInvalidStatus FastlyStatus = 12

	// FastlyStatusLimitExceeded maps to $fastly_status $limitexceeded.
	FastlyStatusLimitExceeded FastlyStatus = 13
)

func IsFastlyError

func IsFastlyError(err error) (FastlyStatus, bool)

IsFastlyError detects and unwraps a FastlyError to its component parts.

func (FastlyStatus) String

func (s FastlyStatus) String() string

String implements fmt.Stringer.

type HTTPBody

type HTTPBody struct{}

func CacheInsert added in v0.1.4

func CacheInsert(key []byte, opts CacheWriteOptions) (*HTTPBody, error)

func NewHTTPBody

func NewHTTPBody() (*HTTPBody, error)

func (*HTTPBody) Abandon added in v0.1.4

func (b *HTTPBody) Abandon() error

func (*HTTPBody) Append

func (b *HTTPBody) Append(other *HTTPBody) error

func (*HTTPBody) Close

func (b *HTTPBody) Close() error

func (*HTTPBody) Read

func (b *HTTPBody) Read(p []byte) (int, error)

func (*HTTPBody) Write

func (b *HTTPBody) Write(p []byte) (n int, err error)

type HTTPRequest

type HTTPRequest struct{}

func NewHTTPRequest

func NewHTTPRequest() (*HTTPRequest, error)

func (*HTTPRequest) AppendHeader

func (r *HTTPRequest) AppendHeader(name, value string) error

func (*HTTPRequest) GetHeaderNames

func (r *HTTPRequest) GetHeaderNames(maxHeaderNameLen int) *Values

func (*HTTPRequest) GetHeaderValue

func (r *HTTPRequest) GetHeaderValue(name string, maxHeaderValueLen int) (string, error)

func (*HTTPRequest) GetHeaderValues

func (r *HTTPRequest) GetHeaderValues(name string, maxHeaderValueLen int) *Values

func (*HTTPRequest) GetMethod

func (r *HTTPRequest) GetMethod() (string, error)

func (*HTTPRequest) GetURI

func (r *HTTPRequest) GetURI() (string, error)

func (*HTTPRequest) GetVersion

func (r *HTTPRequest) GetVersion() (proto string, major, minor int, err error)

func (*HTTPRequest) InsertHeader

func (r *HTTPRequest) InsertHeader(name, value string) error

func (*HTTPRequest) RemoveHeader

func (r *HTTPRequest) RemoveHeader(name string) error

func (*HTTPRequest) Send

func (r *HTTPRequest) Send(requestBody *HTTPBody, backend string) (response *HTTPResponse, responseBody *HTTPBody, err error)

func (*HTTPRequest) SendAsync

func (r *HTTPRequest) SendAsync(requestBody *HTTPBody, backend string) (*PendingRequest, error)

func (*HTTPRequest) SendAsyncStreaming

func (r *HTTPRequest) SendAsyncStreaming(requestBody *HTTPBody, backend string) (*PendingRequest, error)

func (*HTTPRequest) SetAutoDecompressResponse

func (r *HTTPRequest) SetAutoDecompressResponse(options AutoDecompressResponseOptions) error

func (*HTTPRequest) SetCacheOverride

func (r *HTTPRequest) SetCacheOverride(options CacheOverrideOptions) error

func (*HTTPRequest) SetFramingHeadersMode

func (r *HTTPRequest) SetFramingHeadersMode(manual bool) error

func (*HTTPRequest) SetHeaderValues

func (r *HTTPRequest) SetHeaderValues(name string, values []string) error

func (*HTTPRequest) SetMethod

func (r *HTTPRequest) SetMethod(method string) error

func (*HTTPRequest) SetURI

func (r *HTTPRequest) SetURI(uri string) error

func (*HTTPRequest) SetVersion

func (r *HTTPRequest) SetVersion(v HTTPVersion) error

type HTTPResponse

type HTTPResponse struct{}

func NewHTTPResponse

func NewHTTPResponse() (*HTTPResponse, error)

func (*HTTPResponse) AppendHeader

func (r *HTTPResponse) AppendHeader(name, value string) error

func (*HTTPResponse) GetAddrDestIP added in v1.3.3

func (r *HTTPResponse) GetAddrDestIP() (net.IP, error)

func (*HTTPResponse) GetAddrDestPort added in v1.3.3

func (r *HTTPResponse) GetAddrDestPort() (uint16, error)

func (*HTTPResponse) GetHeaderNames

func (r *HTTPResponse) GetHeaderNames(maxHeaderNameLen int) *Values

func (*HTTPResponse) GetHeaderValue

func (r *HTTPResponse) GetHeaderValue(name string, maxHeaderValueLen int) (string, error)

func (*HTTPResponse) GetHeaderValues

func (r *HTTPResponse) GetHeaderValues(name string, maxHeaderValueLen int) *Values

func (*HTTPResponse) GetStatusCode

func (r *HTTPResponse) GetStatusCode() (int, error)

func (*HTTPResponse) GetVersion

func (r *HTTPResponse) GetVersion() (proto string, major, minor int, err error)

func (*HTTPResponse) InsertHeader

func (r *HTTPResponse) InsertHeader(name, value string) error

func (*HTTPResponse) RemoveHeader

func (r *HTTPResponse) RemoveHeader(name string) error

func (*HTTPResponse) SendDownstream

func (r *HTTPResponse) SendDownstream(responseBody *HTTPBody, stream bool) error

func (*HTTPResponse) SetFramingHeadersMode

func (r *HTTPResponse) SetFramingHeadersMode(manual bool) error

func (*HTTPResponse) SetHeaderValues

func (r *HTTPResponse) SetHeaderValues(name string, values []string) error

func (*HTTPResponse) SetStatusCode

func (r *HTTPResponse) SetStatusCode(code int) error

func (*HTTPResponse) SetVersion

func (r *HTTPResponse) SetVersion(v HTTPVersion) error

type HTTPVersion

type HTTPVersion uint32

HTTPVersion describes an HTTP protocol version.

const (
	// HTTPVersionHTTP09 describes HTTP/0.9.
	HTTPVersionHTTP09 HTTPVersion = 0

	// HTTPVersionHTTP10 describes HTTP/1.0.
	HTTPVersionHTTP10 HTTPVersion = 1

	// HTTPVersionHTTP11 describes HTTP/1.1.
	HTTPVersionHTTP11 HTTPVersion = 2

	// HTTPVersionH2 describes HTTP/2.
	HTTPVersionH2 HTTPVersion = 3

	// HTTPVersionH3 describes HTTP/3.
	HTTPVersionH3 HTTPVersion = 4
)

type KVStore added in v0.1.3

type KVStore struct{}

func OpenKVStore added in v0.1.3

func OpenKVStore(name string) (*KVStore, error)

func (*KVStore) Delete added in v1.3.1

func (o *KVStore) Delete(key string) error

func (*KVStore) Insert added in v0.1.3

func (o *KVStore) Insert(key string, value io.Reader) error

func (*KVStore) Lookup added in v0.1.3

func (o *KVStore) Lookup(key string) (io.Reader, error)

type LogEndpoint

type LogEndpoint struct{}

func GetLogEndpoint

func GetLogEndpoint(name string) (*LogEndpoint, error)

func (*LogEndpoint) Write

func (e *LogEndpoint) Write(p []byte) (n int, err error)

type PendingRequest

type PendingRequest struct{}

func (*PendingRequest) Poll

func (r *PendingRequest) Poll() (done bool, response *HTTPResponse, responseBody *HTTPBody, err error)

func (*PendingRequest) Wait

func (r *PendingRequest) Wait() (response *HTTPResponse, responseBody *HTTPBody, err error)

type PurgeOptions added in v0.1.4

type PurgeOptions struct{}

func (*PurgeOptions) SoftPurge added in v0.1.4

func (o *PurgeOptions) SoftPurge(v bool) error

type RateWindow added in v1.3.0

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

func (RateWindow) String added in v1.3.0

func (r RateWindow) String() string

type Secret added in v0.1.2

type Secret struct{}

func SecretFromBytes added in v0.1.7

func SecretFromBytes(b []byte) (*Secret, error)

func (*Secret) Handle added in v1.3.3

func (s *Secret) Handle() secretHandle

func (*Secret) Plaintext added in v0.1.2

func (s *Secret) Plaintext() ([]byte, error)

type SecretStore added in v0.1.2

type SecretStore struct{}

func OpenSecretStore added in v0.1.2

func OpenSecretStore(name string) (*SecretStore, error)

func (*SecretStore) Get added in v0.1.2

func (s *SecretStore) Get(name string) (*Secret, error)

type TLSVersion added in v0.1.5

type TLSVersion prim.U32

witx:

(typename $tls_version
    (enum (@witx tag u32)
      $tls_1
      $tls_1_1
      $tls_1_2
      $tls_1_3))
const (
	TLSVersion1_0 TLSVersion = 0
	TLSVersion1_1 TLSVersion = 1
	TLSVersion1_2 TLSVersion = 2
	TLSVersion1_3 TLSVersion = 3
)

func BackendGetSSLMaxVersion added in v0.1.7

func BackendGetSSLMaxVersion(name string) (TLSVersion, error)

func BackendGetSSLMinVersion added in v0.1.7

func BackendGetSSLMinVersion(name string) (TLSVersion, error)

type Values

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

Values is the result of a multi-value hostcall. It offers an iterator API similar to bufio.Scanner or sql.Rows.

func GetOriginalHeaderNames

func GetOriginalHeaderNames() *Values

func (*Values) Bytes

func (v *Values) Bytes() []byte

Bytes returns the most recent value generated by a call to Next. The underlying array may point to data that will be overwritten by a subsequent call to Next. Bytes performs no allocation.

func (*Values) Err

func (v *Values) Err() error

Err returns the error, if any, that was encountered during iteration.

func (*Values) Next

func (v *Values) Next() bool

Next prepares the next value for reading with the Bytes method. It returns true on success, or false if there are no more values, or an error occurred. Err should be called to distinguish between those two cases. Every call to Bytes, even the first one, must be preceded by a call to Next.

Jump to

Keyboard shortcuts

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