Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateXid() string
- func ToBool[T Primitive](v T) bool
- func ToString[T Primitive](v T) string
- type Acl
- type AclOption
- type Backend
- type BackendOption
- func BackendAlwaysUseHostHeader(v bool) BackendOption
- func BackendBetweenBytesTimeout(t time.Duration) BackendOption
- func BackendConnectTimeout(t time.Duration) BackendOption
- func BackendDefault() BackendOption
- func BackendFirstByteTimeout(t time.Duration) BackendOption
- func BackendHost(host string) BackendOption
- func BackendPort(port string) BackendOption
- func BackendSSL(ssl bool) BackendOption
- type Director
- type DirectorOption
- type DirectorType
- type Logger
- type LoggerInitiator
- type LoggingEndpoint
- type Primitive
- type RawHeader
- type RegexpMatchedGroup
- type RequestIdentity
- type State
- type Table
- type TableOption
Constants ¶
const ( Millisecond time.Duration = time.Millisecond Second time.Duration = time.Second Minute time.Duration = time.Minute Hour time.Duration = time.Hour Day time.Duration = 24 * time.Hour Year time.Duration = 24 * 365 * time.Hour )
Alias of time.Duration for VCL RTIME value
Variables ¶
var LocalHost = net.IPv4(127, 0, 0, 1)
Temporal value of local IP
Functions ¶
func GenerateXid ¶
func GenerateXid() string
Types ¶
type Backend ¶
type Backend struct { Name string IsDefault bool Port string Host string SSL bool AlwaysUseHostHeader bool ConnectTimeout time.Duration FirstByteTimeout time.Duration BetweenBytesTimeout time.Duration Director *Director }
func NewBackend ¶
func NewBackend(name string, opts ...BackendOption) *Backend
func NewDirector ¶
func NewDirector(name string, dType DirectorType, opts ...DirectorOption) *Backend
func (*Backend) Backend ¶
func (b *Backend) Backend(ident RequestIdentity) string
type BackendOption ¶
type BackendOption func(b *Backend)
func BackendAlwaysUseHostHeader ¶
func BackendAlwaysUseHostHeader(v bool) BackendOption
func BackendBetweenBytesTimeout ¶
func BackendBetweenBytesTimeout(t time.Duration) BackendOption
func BackendConnectTimeout ¶
func BackendConnectTimeout(t time.Duration) BackendOption
func BackendDefault ¶
func BackendDefault() BackendOption
func BackendFirstByteTimeout ¶
func BackendFirstByteTimeout(t time.Duration) BackendOption
func BackendHost ¶
func BackendHost(host string) BackendOption
func BackendPort ¶
func BackendPort(port string) BackendOption
func BackendSSL ¶
func BackendSSL(ssl bool) BackendOption
type Director ¶
type Director struct { Type DirectorType Properties map[string]any Backends []map[string]any // contains filtered or unexported fields }
func (*Director) Backend ¶
func (d *Director) Backend(ident RequestIdentity) string
type DirectorOption ¶
type DirectorOption func(d *Director)
func DirectorBackend ¶
func DirectorBackend(opts ...DirectorOption) DirectorOption
func DirectorProperty ¶
func DirectorProperty(key string, value any) DirectorOption
type DirectorType ¶
type DirectorType string
const ( Random DirectorType = "random" Fallback DirectorType = "fallback" Hash DirectorType = "hash" Client DirectorType = "client" CHash DirectorType = "chash" )
type Logger ¶
Define Logger interface to switch native logger that is provided by log package or Fastly logger that is provided by compute-sdk-go/rtlog package
type LoggerInitiator ¶
Logger interface creator function in order to inject Logger interface from each runtimes
type LoggingEndpoint ¶
type LoggingEndpoint struct { Name string // contains filtered or unexported fields }
func NewLoggingEndpoint ¶
func NewLoggingEndpoint(name string, initiator LoggerInitiator) *LoggingEndpoint
func (*LoggingEndpoint) Write ¶
func (l *LoggingEndpoint) Write(message string) error
type RawHeader ¶
RawHeader represents underlying type of http.Header. To abstract HTTP context and WASM runtime could not import net/http package, Our runtime would use as Golang underlying type
type RegexpMatchedGroup ¶
type RegexpMatchedGroup []string
RegexpMatchedGroup represents regexp matched group values which is stored when "~" or "!~" operator is used
func RegexpMatch ¶
func RegexpMatch(pattern, subject string) (bool, RegexpMatchedGroup, error)
RegexpMatch is function that wraps regular expression matching Returns matches result and capture groups
func (RegexpMatchedGroup) At ¶
func (re RegexpMatchedGroup) At(index int) string
type RequestIdentity ¶
type Table ¶
type Table struct { Name string Type string Items map[string]any // contains filtered or unexported fields }
func NewTable ¶
func NewTable(name, itemType string, items ...TableOption) *Table
func (*Table) IsEdgeDictionary ¶
type TableOption ¶
type TableOption func(t *Table)
func EdgeDictionary ¶
func EdgeDictionary() TableOption
func TableItem ¶
func TableItem(name string, value any) TableOption