Documentation ¶
Index ¶
- Constants
- Variables
- func CloseAndLogIfError(ctx context.Context, closer io.Closer, message string)
- func PasswordResponse(err error) *util.JSONResponse
- func SetupHookLogging(hooks []config.LogrusHook, componentName string)
- func SetupPprof()
- func SetupStdLogging()
- func UsernameResponse(err error) *util.JSONResponse
- func ValidateApplicationServiceUsername(localpart string, domain gomatrixserverlib.ServerName) error
- func ValidatePassword(password string) error
- func ValidateUsername(localpart string, domain gomatrixserverlib.ServerName) error
- func VersionString() string
- type MutexByRoom
Constants ¶
const ( VersionMajor = 0 VersionMinor = 11 VersionPatch = 0 VersionTag = "" // example: "rc1" )
Variables ¶
var ( ErrPasswordTooLong = fmt.Errorf("password too long: max %d characters", maxPasswordLength) ErrPasswordWeak = fmt.Errorf("password too weak: min %d characters", minPasswordLength) ErrUsernameTooLong = fmt.Errorf("username exceeds the maximum length of %d characters", maxUsernameLength) ErrUsernameInvalid = errors.New("username can only contain characters a-z, 0-9, or '_-./='") ErrUsernameUnderscore = errors.New("username cannot start with a '_'") )
Functions ¶
func CloseAndLogIfError ¶
CloseAndLogIfError Closes io.Closer and logs the error if any
func PasswordResponse ¶ added in v0.10.9
func PasswordResponse(err error) *util.JSONResponse
PasswordResponse returns a util.JSONResponse for a given error, if any.
func SetupHookLogging ¶
func SetupHookLogging(hooks []config.LogrusHook, componentName string)
SetupHookLogging configures the logging hooks defined in the configuration. If something fails here it means that the logging was improperly configured, so we just exit with the error
func SetupPprof ¶
func SetupPprof()
SetupPprof starts a pprof listener. We use the DefaultServeMux here because it is simplest, and it gives us the freedom to run pprof on a separate port.
func SetupStdLogging ¶
func SetupStdLogging()
SetupStdLogging configures the logging format to standard output. Typically, it is called when the config is not yet loaded.
func UsernameResponse ¶ added in v0.10.9
func UsernameResponse(err error) *util.JSONResponse
UsernameResponse returns a util.JSONResponse for the given error, if any.
func ValidateApplicationServiceUsername ¶ added in v0.10.9
func ValidateApplicationServiceUsername(localpart string, domain gomatrixserverlib.ServerName) error
ValidateApplicationServiceUsername returns an error if the username is invalid for an application service
func ValidatePassword ¶ added in v0.10.9
ValidatePassword returns an error if the password is invalid
func ValidateUsername ¶ added in v0.10.9
func ValidateUsername(localpart string, domain gomatrixserverlib.ServerName) error
ValidateUsername returns an error if the username is invalid
func VersionString ¶
func VersionString() string
Types ¶
type MutexByRoom ¶ added in v0.4.0
type MutexByRoom struct {
// contains filtered or unexported fields
}
func NewMutexByRoom ¶ added in v0.4.0
func NewMutexByRoom() *MutexByRoom
func (*MutexByRoom) Lock ¶ added in v0.4.0
func (m *MutexByRoom) Lock(roomID string)
func (*MutexByRoom) Unlock ¶ added in v0.4.0
func (m *MutexByRoom) Unlock(roomID string)
Directories ¶
Path | Synopsis |
---|---|
Package hooks exposes places in Dendrite where custom code can be executed, useful for MSCs.
|
Package hooks exposes places in Dendrite where custom code can be executed, useful for MSCs. |