shared

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOPAD = "nopad"
	CBC   = "cbc"
	CTR   = "ctr"
	PKCS7 = "pkcs7"
)

Ident values constants

Variables

View Source
var BlockSizeMap = map[string]int{
	"aes128": 16,
	"aes192": 24,
	"aes256": 32,
}

Functions

func IsNegativeZero

func IsNegativeZero(v float64) bool

func IsPositiveZero

func IsPositiveZero(v float64) bool

func IsSubnormalFloat64

func IsSubnormalFloat64(v float64) bool

func IsValidHeader

func IsValidHeader(name string) bool

Types

type CryptoCodec

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

CryptoCodec is common cryptographic for Fastly builtin function

func NewCryptoCodec

func NewCryptoCodec(
	name string,
	cipherId, mode, padding string,
) (*CryptoCodec, error)

func (*CryptoCodec) Decrypt

func (c *CryptoCodec) Decrypt(hexKey, hexIv string, text []byte) ([]byte, error)

func (*CryptoCodec) Encrypt

func (c *CryptoCodec) Encrypt(hexKey, hexIv string, text []byte) ([]byte, error)

type QueryString

type QueryString struct {
	Key   string
	Value []string // nil indicates not set in VCL
}

type QueryStrings

type QueryStrings struct {
	Prefix string // protocol, host, port, path
	Items  []*QueryString
}

We implement original querytring struct in order to maname URL queries keeping its order. url.Values are useful in Golang but Encode() result does not care its order because it is managed in map and always sort by query name. On VCL, we need to keep query raw-order as present, this struct solved them.

func ParseQuery

func ParseQuery(qs string) (*QueryStrings, error)

func (*QueryStrings) Add

func (q *QueryStrings) Add(name, val string)

func (*QueryStrings) Clean

func (q *QueryStrings) Clean()

func (*QueryStrings) Filter

func (q *QueryStrings) Filter(filter func(name string) bool)

func (*QueryStrings) Get

func (q *QueryStrings) Get(name string) *string

func (*QueryStrings) Set

func (q *QueryStrings) Set(name, val string)

func (*QueryStrings) Sort

func (q *QueryStrings) Sort(mode SortMode)

func (*QueryStrings) String

func (q *QueryStrings) String() string

type SortMode

type SortMode string
const (
	SortAsc  SortMode = "asc"
	SortDesc SortMode = "desc"
)

Jump to

Keyboard shortcuts

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