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) DPOEmails() []string
- func (r *Response) DPOMatrixIDs() []string
- 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" // RoleDPO is intended for data protection officer contacts // TODO: currently unused, as MSC4265 mandates the use of RoleDPOUnstable until it is merged into the spec, // ref: bitbucket.org/helloticketscode/curator/internal/services/emailnotifier RoleDPO = "m.role.dpo" // RoleDPOUnstable is intended for data protection officer contacts, used until MSC4265 is merged into the spec RoleDPOUnstable = "org.matrix.msc4265.role.dpo" )
Variables ¶
var ( // UserAgent is the default user agent for the client UserAgent = "Go-MSC1929-client/1.0 (+https://github.com/etkecc/go-msc1929)" // Client will be used to request MSC1929 support file Client *http.Client )
var SupportedRoles = []string{ RoleAdmin, RoleModerator, RoleModeratorUnstable, RoleSecurity, RoleDPO, RoleDPOUnstable, }
SupportedRoles contains all roles that are supported by the support file
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
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
Admins []*Contact `json:"admins,omitempty" yaml:"admins,omitempty"` // Admins list, deprecated since Nov 15, 2023, but still used by some servers
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) DPOMatrixIDs ¶ added in v1.2.0
DPOMatrixIDs returns a list of DPO 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