Documentation ¶
Index ¶
- func LoadPrivateKey(derPath string) (*ecdsa.PrivateKey, error)
- func PrivateKey() (*ecdsa.PrivateKey, error)
- func SavePrivateKey(pk *ecdsa.PrivateKey, derPath string) error
- type Action
- type CertIssuer
- type Config
- type FileStorage
- type Filter
- type LRUStorage
- type Proxy
- type ProxyOpt
- type RedisStorage
- type Rule
- type Snapshot
- type Snapshotter
- type Storage
- type URLData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
func LoadPrivateKey(derPath string) (*ecdsa.PrivateKey, error)
func SavePrivateKey ¶
func SavePrivateKey(pk *ecdsa.PrivateKey, derPath string) error
Types ¶
type Action ¶
type Action string
const ( // Do not allow the request under any circumstances Reject Action = "REJECT" // Only allow requests that have a captured response Locked Action = "LOCKED" // Allow requests matching the pattern, preferring cached responses Allow Action = "ALLOW" // Always refresh, even when in cache Refresh Action = "REFRESH" // Always allow the request, and never cache the response. This should only be used for authentication tokens. RefreshNoStore Action = "NO_STORE" )
func ParseAction ¶
type CertIssuer ¶
type CertIssuer struct {
// contains filtered or unexported fields
}
func NewCertIssuer ¶
func NewCertIssuer(pk *ecdsa.PrivateKey) (*CertIssuer, error)
func (*CertIssuer) CertPEM ¶
func (i *CertIssuer) CertPEM() []byte
func (*CertIssuer) Issue ¶
func (i *CertIssuer) Issue(cn string) (*tls.Certificate, error)
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage(log logr.Logger, blobDir string) (*FileStorage, error)
type LRUStorage ¶
type LRUStorage struct {
// contains filtered or unexported fields
}
func NewLRUStorage ¶
func NewLRUStorage(size int, source Storage) (*LRUStorage, error)
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy acts as an HTTP proxy, and TLS interceptor. HTTP CONNECT requests, as a client would issue for an HTTPS server, are intercepted by a self-signed CA.
func (*Proxy) IssuerCertPEM ¶
type ProxyOpt ¶
type ProxyOpt func(*Proxy)
func ProxyWithLog ¶
func ProxyWithPrivateKey ¶
func ProxyWithPrivateKey(pk *ecdsa.PrivateKey) ProxyOpt
func ProxyWithSocketPath ¶
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewRedisStorage ¶
func NewRedisStorage(redis *redis.Client, prefix string) *RedisStorage
type Rule ¶
type Rule struct { Action Action // contains filtered or unexported fields }
func (*Rule) MatchString ¶
type Snapshot ¶
type Snapshot struct { Data map[string]*URLData `yaml:"data"` // contains filtered or unexported fields }
func LoadSnapshot ¶
func NewSnapshot ¶
func NewSnapshot() *Snapshot
type Snapshotter ¶
type Snapshotter struct {
// contains filtered or unexported fields
}
func NewSnapshotter ¶
func NewSnapshotter(log logr.Logger, snap *Snapshot, storage Storage) *Snapshotter
func (*Snapshotter) ServeHTTP ¶
func (s *Snapshotter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type URLData ¶
type URLData struct { StatusCode int `yaml:"responseCode,omitempty"` ContentType string `yaml:"contentType,omitempty"` ContentLength int `yaml:"contentLength,omitempty"` Sha256 string `yaml:"sha256"` Shake256 string `yaml:"shake256"` }
func NewURLData ¶
func NewURLData(r *httptest.ResponseRecorder) *URLData
Click to show internal directories.
Click to hide internal directories.