Documentation ¶
Index ¶
- Variables
- func LogErrorTo(system bool, w io.Writer)
- func LogErrorToStderr()
- func LogInfoTo(system bool, w io.Writer)
- func LogInfoToStdout()
- func ToActivityStreamsFollow(c Context, t vocab.Type) (f vocab.ActivityStreamsFollow, err error)
- type Context
- func (c Context) Activity() (t pub.Activity, err error)
- func (c Context) ActivityStream() (t vocab.Type, err error)
- func (c Context) ActorIRI() (s *url.URL, err error)
- func (c Context) CompleteRequestURL() (u *url.URL, err error)
- func (c *Context) HasPrivateScope() bool
- func (c Context) UserPathUUID() (s paths.UUID, err error)
- func (c *Context) WithActivity(t pub.Activity)
- func (c *Context) WithActivityStream(t vocab.Type)
- func (c *Context) WithActorIRI(id *url.URL)
- func (c *Context) WithCompleteRequestURL(r *http.Request, scheme, host string)
- func (c *Context) WithPrivateScope(b bool)
- func (c *Context) WithUserPathUUID(uuid paths.UUID)
- type SafeStartStop
Constants ¶
This section is empty.
Variables ¶
var ( // These loggers will only respect the logging flags while the call to // Run is executing. Otherwise, they log to os.Stdout and os.Stderr. InfoLogger *logger.Logger = logger.Init("apcore", false, false, os.Stdout) ErrorLogger *logger.Logger = logger.Init("apcore", false, false, os.Stderr) )
Functions ¶
func LogErrorTo ¶
func LogErrorToStderr ¶
func LogErrorToStderr()
func LogInfoToStdout ¶
func LogInfoToStdout()
func ToActivityStreamsFollow ¶
Types ¶
type Context ¶
func WithAPHTTPContext ¶
WithAPHTTPContext sets the CompleteRequestURL.
func WithUserAPHTTPContext ¶
func WithUserAPHTTPContext(scheme, host string, r *http.Request, uuid paths.UUID, authdUserID string) Context
WithUserAPHTTPContext sets the UserPathUUID, ActorIRI, CompleteRequestURL, and PrivateScope.
func (Context) ActivityStream ¶
ActivityStream is available in social contexts.
func (Context) CompleteRequestURL ¶
CompleteRequestURL is used for ActivityPub HTTP contexts.
func (*Context) HasPrivateScope ¶
HasPrivateScope is available in all GET http requests.
func (Context) UserPathUUID ¶
UserPathUUID is used for ActivityPub HTTP contexts.
func (*Context) WithActivity ¶
WithActivity is used for federating contexts.
func (*Context) WithActivityStream ¶
WithActivityStream is used for social contexts.
func (*Context) WithActorIRI ¶
WithActorIRI is used for ActivityPub Inbox/Outbox contexts.
func (*Context) WithCompleteRequestURL ¶
WithCompleteRequestURL is used for all ActivityPub HTTP contexts.
func (*Context) WithPrivateScope ¶
WithPrivateScope is available in all GET http requests.
func (*Context) WithUserPathUUID ¶
WithUserID is used for ActivityPub Inbox/Outbox contexts.
type SafeStartStop ¶
type SafeStartStop struct {
// contains filtered or unexported fields
}
SafeStartStop guarantees at most one asynchronous function is being periodically run, no matter how many asynchronous calls to Start or Stop are being invoked.
There is no order to how the
func NewSafeStartStop ¶
func NewSafeStartStop(fn func(context.Context), period time.Duration) *SafeStartStop
func (*SafeStartStop) Start ¶
func (s *SafeStartStop) Start()
func (*SafeStartStop) Stop ¶
func (s *SafeStartStop) Stop()