Documentation ¶
Index ¶
- Constants
- Variables
- func IntegrationTest(t *testing.T, factory proto.BackendFactory)
- func LoadPageTemplates(path string) (*templates.Templater, error)
- func NewIdentity(id proto.UserID, name string) proto.Identity
- func RegisterBackend(name string, factory proto.BackendFactory)
- func ValidatePageTemplates(templater *templates.Templater) []error
- type CSV
- type ClusterConfig
- type ConsoleConfig
- type DatabaseConfig
- type EmailConfig
- type GeoIPConfig
- type KMSConfig
- type Server
- type ServerConfig
- func (cfg *ServerConfig) GetBackend(heim *proto.Heim) (proto.Backend, error)
- func (cfg *ServerConfig) Heim(ctx scope.Context) (*proto.Heim, error)
- func (cfg *ServerConfig) LoadFromEtcd(c cluster.Cluster) error
- func (cfg *ServerConfig) LoadFromFile(path string) error
- func (cfg *ServerConfig) String() string
Constants ¶
View Source
const ( RoomPage = "room.html" ResetPasswordPage = "reset-password.html" VerifyEmailPage = "verify-email.html" )
View Source
const ( MaxKeepAliveMisses = 3 MaxAuthFailures = 5 MaxConsecutiveThrottled = 10 )
Variables ¶
View Source
var ( KeepAlive = 20 * time.Second FastKeepAlive = 2 * time.Second ErrUnresponsive = fmt.Errorf("connection unresponsive") ErrReplaced = fmt.Errorf("connection replaced") ErrFlooding = fmt.Errorf("connection flooding") )
View Source
var ( Config = ServerConfig{ CommonEmailParams: &proto.DefaultCommonEmailParams, } )
View Source
var PageScenarios = map[string]map[string]templates.TemplateTest{ RoomPage: map[string]templates.TemplateTest{ "default": templates.TemplateTest{ Data: map[string]interface{}{"RoomName": "test"}, }, }, ResetPasswordPage: map[string]templates.TemplateTest{ "default": templates.TemplateTest{ Data: map[string]interface{}{ "Data": map[string]interface{}{ "email": "test@test.invalid", "confirmation": "confirmationcode", }, }, }, }, VerifyEmailPage: map[string]templates.TemplateTest{ "default": templates.TemplateTest{ Data: map[string]interface{}{ "Data": map[string]interface{}{ "email": "test@test.invalid", "confirmation": "confirmationcode", }, }, }, }, }
Functions ¶
func IntegrationTest ¶
func IntegrationTest(t *testing.T, factory proto.BackendFactory)
func RegisterBackend ¶
func RegisterBackend(name string, factory proto.BackendFactory)
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { ServerID string `yaml:"server-id"` Era string `yaml:"-"` Version string `yaml:"-"` EtcdHost string `yaml:"etcd-host,omitempty"` EtcdHome string `yaml:"etcd,omitempty"` }
func (*ClusterConfig) DescribeSelf ¶
func (c *ClusterConfig) DescribeSelf() *cluster.PeerDesc
type ConsoleConfig ¶
type DatabaseConfig ¶
type EmailConfig ¶
type EmailConfig struct { Server string `yaml:"server"` AuthMethod string `yaml:"auth_method"` // must be "", "CRAM-MD5", or "PLAIN" Username string `yaml:"username"` Password string `yaml:"password"` Identity string `yaml:"identity"` UseTLS bool `yaml:"use_tls"` Templates string `yaml:"templates"` }
func (*EmailConfig) Get ¶
func (ec *EmailConfig) Get(cfg *ServerConfig) (*templates.Templater, emails.Deliverer, error)
type GeoIPConfig ¶
func (*GeoIPConfig) Api ¶
func (c *GeoIPConfig) Api() *geoip2.Api
type KMSConfig ¶
type Server ¶
type ServerConfig ¶
type ServerConfig struct { *proto.CommonEmailParams `yaml:"site"` AllowRoomCreation bool `yaml:"allow_room_creation"` NewAccountMinAgentAge time.Duration `yaml:"new_account_min_agent_age"` RoomEntryMinAgentAge time.Duration `yaml:"room_entry_min_agent_age"` SetInsecureCookies bool `yaml:"set_insecure_cookies"` StaticPath string `yaml:"static_path"` Cluster ClusterConfig `yaml:"cluster,omitempty"` Console ConsoleConfig `yaml:"console,omitempty"` DB DatabaseConfig `yaml:"database"` KMS KMSConfig `yaml:"kms"` Email EmailConfig `yaml:"email"` GeoIP GeoIPConfig `yaml:"geoip"` }
func (*ServerConfig) GetBackend ¶
func (*ServerConfig) LoadFromEtcd ¶
func (cfg *ServerConfig) LoadFromEtcd(c cluster.Cluster) error
func (*ServerConfig) LoadFromFile ¶
func (cfg *ServerConfig) LoadFromFile(path string) error
func (*ServerConfig) String ¶
func (cfg *ServerConfig) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.