Documentation ¶
Index ¶
- Variables
- func GetRemoteAddr(ctx context.Context) string
- func PtrValue[T any](t T) *T
- func RegisterOriginType(typeName string, originConfigConstructor func() OriginConfig)
- func UnregisterOriginType(typeName string)
- func WithProxyConnOnQueryReceived(handler ProxyConnOnQueryReceivedHandlerFunc) func(opts *ProxyConnOptions)
- func WithProxyConnTLS(tlsConfig *tls.Config) func(opts *ProxyConnOptions)
- type CacheDatabaseConfig
- type CacheInfo
- type CacheWriter
- type CertificateConfig
- type Column
- type CommonOriginConfig
- type Config
- type Notifier
- type Origin
- type OriginConfig
- type OriginNotFoundError
- type ProxyConn
- type ProxyConnOnQueryReceivedHandlerFunc
- type ProxyConnOptions
- type ProxyConnection
- type Server
- type ServerStats
- type StatsConfig
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Version = "current"
)
Functions ¶
func GetRemoteAddr ¶
func RegisterOriginType ¶
func RegisterOriginType(typeName string, originConfigConstructor func() OriginConfig)
func UnregisterOriginType ¶
func UnregisterOriginType(typeName string)
func WithProxyConnOnQueryReceived ¶
func WithProxyConnOnQueryReceived(handler ProxyConnOnQueryReceivedHandlerFunc) func(opts *ProxyConnOptions)
func WithProxyConnTLS ¶
func WithProxyConnTLS(tlsConfig *tls.Config) func(opts *ProxyConnOptions)
Types ¶
type CacheDatabaseConfig ¶
type CacheDatabaseConfig struct { Host string `yaml:"host,omitempty"` Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` Port int `yaml:"port,omitempty"` Database string `yaml:"database,omitempty"` SSLMode string `yaml:"ssl_mode,omitempty"` }
func (*CacheDatabaseConfig) DSN ¶
func (cfg *CacheDatabaseConfig) DSN() string
type CacheWriter ¶
type CertificateConfig ¶
type CommonOriginConfig ¶
type CommonOriginConfig struct { ID string `yaml:"id"` Type string `yaml:"type"` TTL *time.Duration `yaml:"ttl"` OriginConfig OriginConfig `yaml:"-"` }
func (*CommonOriginConfig) NewOrigin ¶
func (cfg *CommonOriginConfig) NewOrigin() (Origin, error)
func (*CommonOriginConfig) Ristrict ¶
func (cfg *CommonOriginConfig) Ristrict() error
func (*CommonOriginConfig) UnmarshalYAML ¶
func (cfg *CommonOriginConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type Config ¶
type Config struct { RequiredVersion string `yaml:"required_version,omitempty"` CacheDatabase *CacheDatabaseConfig `yaml:"cache_database,omitempty"` Certificates []*CertificateConfig `yaml:"certificates,omitempty"` DefaultTTL time.Duration `yaml:"default_ttl,omitempty"` Origins []*CommonOriginConfig `yaml:"origins,omitempty"` InitialFetch bool `yaml:"initial_fetch,omitempty"` IdleTimeout *time.Duration `yaml:"idle_timeout,omitempty"` CacheControllTimeout *time.Duration `yaml:"cache_controll_timeout,omitempty"` Stats *StatsConfig `yaml:"stats,omitempty"` // contains filtered or unexported fields }
func DefaultConfig ¶
func DefaultConfig() *Config
type OriginConfig ¶
func GetOriginConfig ¶
func GetOriginConfig(typeName string) (OriginConfig, bool)
type OriginNotFoundError ¶
type OriginNotFoundError struct {
// contains filtered or unexported fields
}
func WrapOriginNotFoundError ¶
func WrapOriginNotFoundError(err error) *OriginNotFoundError
func (*OriginNotFoundError) Error ¶
func (onfe *OriginNotFoundError) Error() string
func (*OriginNotFoundError) Unwrap ¶
func (onfe *OriginNotFoundError) Unwrap() error
type ProxyConn ¶
type ProxyConn struct {
// contains filtered or unexported fields
}
func NewProxyConn ¶
func (*ProxyConn) ExtendDeadline ¶ added in v0.1.0
func (*ProxyConn) SetIdleTimeout ¶ added in v0.1.0
type ProxyConnOnQueryReceivedHandlerFunc ¶ added in v0.1.0
type ProxyConnOptions ¶
type ProxyConnOptions struct {
// contains filtered or unexported fields
}
type ProxyConnection ¶
type ProxyConnection struct { *pgx.Conn // contains filtered or unexported fields }
func (*ProxyConnection) ID ¶
func (conn *ProxyConnection) ID() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetStats ¶ added in v0.1.0
func (server *Server) GetStats() *ServerStats
GetStats returns ServerStats of app
func (*Server) RunWithContext ¶
type ServerStats ¶ added in v0.1.0
type ServerStats struct { Hostname string `ltsv:"hostname"` Pid int `ltsv:"pid"` Uptime int64 `ltsv:"uptime"` Time int64 `ltsv:"time"` Version string `ltsv:"version"` CurrConnections int64 `ltsv:"curr_connections"` TotalConnections int64 `ltsv:"total_connections"` Queries int64 `ltsv:"queries"` CacheHits int64 `ltsv:"cache_hits"` CacheMisses int64 `ltsv:"cache_misses"` MemoryAlloc uint64 `ltsv:"memory_alloc"` }
func (*ServerStats) InsertInto ¶ added in v0.1.0
func (stats *ServerStats) InsertInto(ctx context.Context, tx pgx.Tx) error
func (*ServerStats) Loatate ¶ added in v0.1.0
func (stats *ServerStats) Loatate(ctx context.Context, tx pgx.Tx) error
func (*ServerStats) String ¶ added in v0.1.0
func (stats *ServerStats) String() string
type StatsConfig ¶ added in v0.1.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.