Documentation ¶
Index ¶
- Constants
- func AuthorizeContext(ctx context.Context) context.Context
- type AuthConfiguration
- type Claims
- type Configuration
- type Configurator
- type HTTPError
- type Mention
- type PagedMentionList
- type ReceiverConfiguration
- type RequestPolicy
- type SendRequest
- type SendResponse
- type SendResponseTargetStatus
- type SenderConfiguration
- type Server
- func (srv *Server) MigrateDatabase(ctx context.Context) error
- func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (srv *Server) StartVerifier(ctx context.Context)
- func (srv *Server) UpdateGlobalMetrics(ctx context.Context) error
- func (srv *Server) VerifyNextMention(ctx context.Context) (bool, error)
- type StaticAccessKey
Constants ¶
View Source
const MentionStatusApproved = "approved"
View Source
const MentionStatusInvalid = "invalid"
View Source
const MentionStatusNew = "new"
View Source
const MentionStatusRejected = "rejected"
View Source
const MentionStatusVerified = "verified"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfiguration ¶
type Configuration ¶
type Configuration struct { Context context.Context Database *sql.DB MigrationsFolder string Receiver ReceiverConfiguration Sender SenderConfiguration Auth AuthConfiguration MailFrom string Mailer mailer.Mailer AllowedOrigins []string PublicURL string UIPath string VerificationTimeoutDuration time.Duration VerificationMaxRedirects int NotifyOnVerification bool Policies *policies.Registry PolicyLoader policies.Loader ExposeMetrics bool }
type Configurator ¶
type Configurator func(c *Configuration)
type Mention ¶
type Mention struct { ID string `json:"id"` Source string `json:"source"` Target string `json:"target"` CreatedAt string `json:"created_at"` Status string `json:"status,omitempty"` Title string `json:"title,omitempty"` Content string `json:"content,omitempty"` AuthorName string `json:"author_name,omitempty"` Type string `json:"type,omitempty"` RSVP string `json:"rsvp,omitempty"` }
type PagedMentionList ¶
type ReceiverConfiguration ¶
type ReceiverConfiguration struct {
TargetPolicy RequestPolicy
}
type RequestPolicy ¶
RequestPolicy functions allow you to mark incoming requests as allowed or denied.
func RequestPolicyAllowHost ¶
func RequestPolicyAllowHost(hosts ...string) RequestPolicy
RequestPolicyAllowHost creates a policy that allows only requests targeted at specific hosts.
type SendRequest ¶
type SendRequest struct {
Source string `json:"source"`
}
type SendResponse ¶
type SendResponse struct { Source string `json:"source"` Targets []SendResponseTargetStatus `json:"targets"` }
type SenderConfiguration ¶
type SenderConfiguration struct{}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the http.Handler interface and deals with inserting new webmentions into the database.
func New ¶
func New(configurators ...Configurator) *Server
func (*Server) MigrateDatabase ¶
MigrateDatabase tries to update the underlying database to the latest version.
func (*Server) StartVerifier ¶
func (*Server) UpdateGlobalMetrics ¶
type StaticAccessKey ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.