Documentation ¶
Index ¶
- func Barebones(ctx context.Context) bool
- func DryRun(ctx context.Context) bool
- func HTTPClientSignFunc(ctx context.Context) func(*http.Request) error
- func HTTPSignature(ctx context.Context) string
- func HTTPSignaturePubKeyID(ctx context.Context) *url.URL
- func HTTPSignatureVerifier(ctx context.Context) httpsig.VerifierWithOptions
- func IsFastfail(ctx context.Context) bool
- func OtherIRIs(ctx context.Context) []*url.URL
- func OutgoingPublicKeyID(ctx context.Context) string
- func ReceivingAccount(ctx context.Context) *gtsmodel.Account
- func RequestID(ctx context.Context) string
- func RequestingAccount(ctx context.Context) *gtsmodel.Account
- func SetBarebones(ctx context.Context) context.Context
- func SetDryRun(ctx context.Context) context.Context
- func SetFastFail(ctx context.Context) context.Context
- func SetHTTPClientSignFunc(ctx context.Context, fn func(*http.Request) error) context.Context
- func SetHTTPSignature(ctx context.Context, signature string) context.Context
- func SetHTTPSignaturePubKeyID(ctx context.Context, pubKeyID *url.URL) context.Context
- func SetHTTPSignatureVerifier(ctx context.Context, verifier httpsig.VerifierWithOptions) context.Context
- func SetOtherIRIs(ctx context.Context, iris []*url.URL) context.Context
- func SetOutgoingPublicKeyID(ctx context.Context, id string) context.Context
- func SetReceivingAccount(ctx context.Context, acct *gtsmodel.Account) context.Context
- func SetRequestID(ctx context.Context, id string) context.Context
- func SetRequestingAccount(ctx context.Context, acct *gtsmodel.Account) context.Context
- func WithValues(ctx context.Context, values context.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Barebones ¶
Barebones returns whether the "barebones" context key has been set. This can be used to indicate to the database, for example, that only a barebones model need be returned, Allowing it to skip populating sub models.
func DryRun ¶ added in v0.10.0
DryRun returns whether the "dryrun" context key has been set. This can be used to indicate to functions, (that support it), that only a dry-run of the operation should be performed. As opposed to making any permanent changes.
func HTTPClientSignFunc ¶ added in v0.15.0
HTTPClientSignFunc returns an httpclient signing function for the current client request context. This can be used to resign a request as calling transport's user.
func HTTPSignature ¶ added in v0.10.0
HTTPSignature returns the http signature string value for the current ActivityPub request chain.
func HTTPSignaturePubKeyID ¶ added in v0.10.0
HTTPSignaturePubKeyID returns the public key id of the http signature for the current ActivityPub request chain.
func HTTPSignatureVerifier ¶ added in v0.10.0
func HTTPSignatureVerifier(ctx context.Context) httpsig.VerifierWithOptions
HTTPSignatureVerifier returns an http signature verifier for the current ActivityPub request chain. This verifier can be called to authenticate the current request.
func IsFastfail ¶ added in v0.9.0
IsFastFail returns whether the "fastfail" context key has been set. This can be used to indicate to an http client, for example, that the result of an outgoing request is time sensitive and so not to bother with retries.
func OtherIRIs ¶ added in v0.10.0
OtherIRIs returns other IRIs which are involved in the current ActivityPub request chain. This usually means: other accounts who are mentioned, CC'd, TO'd, or boosted by the current inbox POST request.
func OutgoingPublicKeyID ¶ added in v0.10.0
OutgoingPublicKeyID returns the public key ID (URI) associated with context. This value is useful for logging situations in which a given public key URI is relevant, e.g. for outgoing requests being signed by the given key.
func ReceivingAccount ¶ added in v0.10.0
ReceivingAccount returns the local account who owns the resource being interacted with (inbox, uri, etc) in the current ActivityPub request chain.
func RequestID ¶ added in v0.9.0
RequestID returns the request ID associated with context. This value will usually be set by the request ID middleware handler, either pulling an existing supplied value from request headers, or generating a unique new entry. This is useful for tying together log entries associated with an original incoming request.
func RequestingAccount ¶ added in v0.10.0
RequestingAccount returns the remote account interacting with a local resource (inbox, uri, etc) in the current ActivityPub request chain.
func SetBarebones ¶
SetBarebones sets the "barebones" context flag and returns this wrapped context. See Barebones() for further information on the "barebones" context flag.
func SetDryRun ¶ added in v0.10.0
SetDryRun sets the "dryrun" context flag and returns this wrapped context. See DryRun() for further information on the "dryrun" context flag.
func SetFastFail ¶ added in v0.9.0
SetFastFail sets the "fastfail" context flag and returns this wrapped context. See IsFastFail() for further information on the "fastfail" context flag.
func SetHTTPClientSignFunc ¶ added in v0.15.0
SetHTTPClientSignFunc stores the given httpclient signing function and returns the wrapped context. See HTTPClientSignFunc() for further information on the signing function value.
func SetHTTPSignature ¶ added in v0.10.0
SetHTTPSignature stores the given http signature string and returns the wrapped context. See HTTPSignature() for further information on the verifier value.
func SetHTTPSignaturePubKeyID ¶ added in v0.10.0
SetHTTPSignaturePubKeyID stores the given http signature public key id and returns the wrapped context. See HTTPSignaturePubKeyID() for further information on the value.
func SetHTTPSignatureVerifier ¶ added in v0.10.0
func SetHTTPSignatureVerifier(ctx context.Context, verifier httpsig.VerifierWithOptions) context.Context
SetHTTPSignatureVerifier stores the given http signature verifier and returns the wrapped context. See HTTPSignatureVerifier() for further information on the verifier value.
func SetOtherIRIs ¶ added in v0.10.0
SetOtherIRIs stores the given IRIs slice and returns the wrapped context. See OtherIRIs() for further information on the IRIs slice value.
func SetOutgoingPublicKeyID ¶ added in v0.10.0
SetOutgoingPublicKeyID stores the given public key ID value and returns the wrapped context. See PublicKeyID() for further information on the public key ID value.
func SetReceivingAccount ¶ added in v0.10.0
SetReceivingAccount stores the given receiving account value and returns the wrapped context. See ReceivingAccount() for further information on the receiving account value.
func SetRequestID ¶ added in v0.9.0
SetRequestID stores the given request ID value and returns the wrapped context. See RequestID() for further information on the request ID value.
func SetRequestingAccount ¶ added in v0.10.0
SetRequestingAccount stores the given requesting account value and returns the wrapped context. See RequestingAccount() for further information on the requesting account value.
Types ¶
This section is empty.