Documentation ¶
Index ¶
- Constants
- type Client
- type Maintenance
- type MaintenanceMode
- type MemcachedClient
- func (c *MemcachedClient) Disable() error
- func (c *MemcachedClient) DisableAllowedIPs() error
- func (c *MemcachedClient) GetAllowedIPs() ([]string, error)
- func (c *MemcachedClient) GetMaintenance() *maintenanceMode
- func (c *MemcachedClient) SetAllowedIPs(ips []string) error
- func (c *MemcachedClient) SetMessage(msg []byte) error
- type RedisClient
- func (c *RedisClient) Disable() error
- func (c *RedisClient) DisableAllowedIPs() error
- func (c *RedisClient) GetAllowedIPs() ([]string, error)
- func (c *RedisClient) GetMaintenance() *maintenanceMode
- func (c *RedisClient) SetAllowedIPs(ips []string) error
- func (c *RedisClient) SetMessage(msg []byte) error
Constants ¶
View Source
const AllowedIPsKey = "maintenance_allowed_ips"
View Source
const MaintenanceKey = "maintenance"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetMaintenance() *maintenanceMode GetAllowedIPs() ([]string, error) SetMessage([]byte) error SetAllowedIPs([]string) error Disable() error DisableAllowedIPs() error }
func NewMemcachedClient ¶
func NewRedisClient ¶
type Maintenance ¶
type Maintenance interface { SetMaintenance(next http.Handler) http.Handler AllowByIP(next http.Handler) http.Handler ResponseIfMaintenanceMode(next http.Handler) http.Handler }
func NewMaintenanceMemcachedBackend ¶
func NewMaintenanceMemcachedBackend(url string) Maintenance
func NewMaintenanceRedisBackend ¶
func NewMaintenanceRedisBackend(opt *redis.Options) Maintenance
type MaintenanceMode ¶
type MaintenanceMode interface { IsEnabled() bool Disable() }
type MemcachedClient ¶
type MemcachedClient struct { URL string // contains filtered or unexported fields }
func (*MemcachedClient) Disable ¶
func (c *MemcachedClient) Disable() error
func (*MemcachedClient) DisableAllowedIPs ¶
func (c *MemcachedClient) DisableAllowedIPs() error
func (*MemcachedClient) GetAllowedIPs ¶
func (c *MemcachedClient) GetAllowedIPs() ([]string, error)
func (*MemcachedClient) GetMaintenance ¶
func (c *MemcachedClient) GetMaintenance() *maintenanceMode
func (*MemcachedClient) SetAllowedIPs ¶
func (c *MemcachedClient) SetAllowedIPs(ips []string) error
func (*MemcachedClient) SetMessage ¶
func (c *MemcachedClient) SetMessage(msg []byte) error
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func (*RedisClient) Disable ¶
func (c *RedisClient) Disable() error
func (*RedisClient) DisableAllowedIPs ¶
func (c *RedisClient) DisableAllowedIPs() error
func (*RedisClient) GetAllowedIPs ¶
func (c *RedisClient) GetAllowedIPs() ([]string, error)
func (*RedisClient) GetMaintenance ¶
func (c *RedisClient) GetMaintenance() *maintenanceMode
func (*RedisClient) SetAllowedIPs ¶
func (c *RedisClient) SetAllowedIPs(ips []string) error
func (*RedisClient) SetMessage ¶
func (c *RedisClient) SetMessage(msg []byte) error
Click to show internal directories.
Click to hide internal directories.