Documentation
¶
Index ¶
- Constants
- Variables
- type Contact
- type Response
- func (r *Response) AdminEmails() []string
- func (r *Response) AdminMatrixIDs() []string
- func (r *Response) AllEmails() []string
- func (r *Response) AllMatrixIDs() []string
- func (r *Response) Clone() *Response
- func (r *Response) IsEmpty() bool
- func (r *Response) ModeratorEmails() []string
- func (r *Response) ModeratorMatrixIDs() []string
- func (r *Response) Sanitize()
- func (r *Response) SecurityEmails() []string
- func (r *Response) SecurityMatrixIDs() []string
Constants ¶
const ( // RoleAdmin is catch-all user for any queries RoleAdmin = "m.role.admin" // RoleModerator is intended for moderation requests // TODO: currently unused, as MSC4121 mandates the use of RoleModeratorUnstable until it is merged into the spec, // ref: https://github.com/FSG-Cat/matrix-spec-proposals/blob/FSG-Cat-Moderation-Role-well-known-support-record/proposals/4121-m.role.moderator.md#unstable-prefix RoleModerator = "m.role.moderator" // RoleModeratorUnstable is intended for moderation requests, used until MSC4121 is merged into the spec RoleModeratorUnstable = "support.feline.msc4121.role.moderator" // RoleSecurity is intended for sensitive requests RoleSecurity = "m.role.security" )
Variables ¶
var ( // Client will be used to request MSC1929 support file Client *http.Client )
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct {
Email string `json:"email_address,omitempty" yaml:"email_address,omitempty"`
MatrixID string `json:"matrix_id,omitempty" yaml:"matrix_id,omitempty"`
Role string `json:"role,omitempty" yaml:"role,omitempty"`
}
Contact details
func (*Contact) IsEmpty ¶
IsEmpty checks if contact contains at least one contact (either email or mxid)
func (*Contact) IsModerator ¶
IsModerator checks if contact has moderator role TODO: currently uses RoleModeratorUnstable, as MSC4121 mandates the use of RoleModeratorUnstable until it is merged into the spec,
func (*Contact) IsSecurity ¶
IsSecurity checks if contact has security role
type Response ¶
type Response struct {
Contacts []*Contact `json:"contacts,omitempty" yaml:"contacts,omitempty"` // Contacts list
SupportPage string `json:"support_page,omitempty" yaml:"support_page,omitempty"` // SupportPage URL
// contains filtered or unexported fields
}
Response of the MSC1929 support file
func GetWithContext ¶
GetWithContext MSC1929 support file from serverName
func ParseMSC1929 ¶
ParseMSC1929 parses MSC1929 support file
func (*Response) AdminEmails ¶
AdminEmails returns a list of admin emails
func (*Response) AdminMatrixIDs ¶
AdminMatrixIDs returns a list of admin matrix IDs
func (*Response) AllMatrixIDs ¶
AllMatrixIDs returns a list of all matrix IDs
func (*Response) IsEmpty ¶
IsEmpty checks if response contains at least one contact (either email or mxid) or SupportPage
func (*Response) ModeratorEmails ¶
ModeratorEmails returns a list of moderator emails
func (*Response) ModeratorMatrixIDs ¶
ModeratorMatrixIDs returns a list of moderator matrix IDs
func (*Response) Sanitize ¶
func (r *Response) Sanitize()
Sanitize ensures that all fields are valid, and removes those that are not
func (*Response) SecurityEmails ¶
SecurityEmails returns a list of security emails
func (*Response) SecurityMatrixIDs ¶
SecurityMatrixIDs returns a list of security matrix IDs