Documentation
¶
Index ¶
- Constants
- Variables
- func BootstrapStorage(conf config.Options, service vocab.Item, l lw.Logger) error
- func ByName(names ...string) url.Values
- func ByType(types ...vocab.ActivityVocabularyType) url.Values
- func ByURL(urls ...vocab.IRI) url.Values
- func CreateService(r s.FullStorage, self vocab.Item) (err error)
- func Errf(s string, par ...any)
- func IRIWithFilters(iri vocab.IRI, searchParams ...url.Values) vocab.IRI
- func ResetStorage(conf config.Options, l lw.Logger) error
- func SearchActorsIRI(baseIRI vocab.IRI, searchParams ...url.Values) vocab.IRI
- type Accounts
- type ActorsCmd
- type AddActorCmd
- type AddClient
- type AddCmd
- type AddToken
- type BootstrapCmd
- type CTL
- type ChangePassword
- type Client
- type Control
- func (c *Control) AddActor(p *vocab.Person, pw []byte, author vocab.Actor) (*vocab.Person, error)
- func (c *Control) AddClient(pw []byte, redirectUris []string, u any) (string, error)
- func (c *Control) AddObject(p *vocab.Object, author vocab.Actor) (*vocab.Object, error)
- func (c *Control) CopyObjects(to vocab.IRI, from ...vocab.IRI) error
- func (c *Control) DeleteClient(id string) error
- func (c *Control) DeleteObjects(reason string, inReplyTo []string, ids ...vocab.IRI) error
- func (c *Control) GenAuthToken(clientID, actorIdentifier string, _ any) (string, error)
- func (c *Control) List(iris vocab.IRIs, types ...vocab.ActivityVocabularyType) (vocab.ItemCollection, error)
- func (c *Control) ListClients() ([]osin.Client, error)
- func (c *Control) MoveObjects(to vocab.IRI, from ...vocab.IRI) error
- func (c *Control) SendSignal(sig syscall.Signal) error
- type CopyCmd
- type DelClient
- type DeleteCmd
- type Export
- type ExportCmd
- type FixCollections
- type GenKeys
- type Import
- type ImportCmd
- type IndexCmd
- type InfoCmd
- type ListCmd
- type LsClient
- type Maintenance
- type MoveCmd
- type OAuth
- type Pub
- type Reload
- type ResetCmd
- type Run
- type Stop
- type Storage
- type Token
Constants ¶
View Source
const AppName = "FedBOX"
View Source
const URISeparator = "\n"
Variables ¶
View Source
var ValidGenericTypes = vocab.ActivityVocabularyTypes{vocab.ObjectType, vocab.ActorType}
Functions ¶
func BootstrapStorage ¶
func CreateService ¶
func CreateService(r s.FullStorage, self vocab.Item) (err error)
Types ¶
type Accounts ¶
type Accounts struct { Export Export `cmd:"" help:"Exports accounts metadata."` Import Import `cmd:"" help:"Imports accounts metadata."` GenKeys GenKeys `cmd:"" help:"Generate public/private key pairs for actors that are missing them."` Pass ChangePassword `cmd:"" help:"Change password for an actor."` }
type ActorsCmd ¶
type ActorsCmd struct {
Add AddActorCmd `cmd:"" help:"Adds an ActivityPub actor."`
}
type AddActorCmd ¶
type AddActorCmd struct { Type vocab.ActivityVocabularyType `help:"The type of the ActivityPub actor to add."` KeyType string `help:"Type of keys to generate: ${keyTypes}" enum:"${keyTypes}" default:"${defaultKeyType}"` AttributedTo vocab.IRI `help:"The IRI of the Actor we should use as author."` Tags []string `name:"tag" help:"The tag(s) to attach to the actor."` Names []string `arg:"" name:"name" help:"The name(s) of the actor."` }
func (AddActorCmd) Run ¶
func (a AddActorCmd) Run(ctl *Control) error
type AddClient ¶
type AddClient struct {
RedirectURIs []string `name:"redirect-uri" help:"The redirect URIs for current application"`
}
type AddCmd ¶
type AddCmd struct { Type vocab.ActivityVocabularyType `help:"The type of ActivityPub object(s) to create." default:"${defaultObjectTypes}"` Name string `help:"The name of the ActivityPub object(s) to create."` AttributedTo string `help:"The IRI of the Actor we should use as author"` Tag []string `help:"The tag(s) to attach to the object."` }
type AddToken ¶
type BootstrapCmd ¶
type BootstrapCmd struct {
KeyType string `help:"Type of keys to generate: ${keyTypes}" enum:"${keyTypes}" default:"${defaultKeyType}"`
}
func (BootstrapCmd) Run ¶
func (b BootstrapCmd) Run(ctl *Control) error
type CTL ¶
type CTL struct { Url url.URL `help:"The URL used by the application."` Env env.Type `enum:"${envTypes}" help:"The environment to use. Expected values: ${envTypes}" default:"${defaultEnv}"` Verbose int `counter:"v" help:"Increase verbosity level from the default associated with the environment settings."` Path string `path:"" help:"The path for the storage folder or socket" default:"." env:"STORAGE_PATH"` Version kong.VersionFlag `short:"V"` // Commands Pub Pub `cmd:"" name:"pub" alt:"ap" help:"ActivityPub management helper"` OAuth OAuth `cmd:"" name:"oauth"` Storage Storage `cmd:""` Accounts Accounts `cmd:"" help:"Accounts helper."` Maintenance Maintenance `cmd:"" help:"Toggle maintenance mode for the main FedBOX server."` Reload Reload `cmd:"" help:"Reload the main FedBOX server configuration"` Stop Stop `cmd:"" help:"Stops the main FedBOX server configuration"` // contains filtered or unexported fields }
type ChangePassword ¶
type ChangePassword struct {
IRI vocab.IRI `arg:"" optional:"" name:"iri" help:"The actor for which to change the password."`
}
func (ChangePassword) Run ¶
func (c ChangePassword) Run(ctl *Control) error
type Control ¶
type Control struct { Conf config.Options Logger lw.Logger Service vocab.Actor Storage st.FullStorage }
func (*Control) DeleteClient ¶
func (*Control) DeleteObjects ¶
func (*Control) GenAuthToken ¶
func (*Control) List ¶
func (c *Control) List(iris vocab.IRIs, types ...vocab.ActivityVocabularyType) (vocab.ItemCollection, error)
type CopyCmd ¶
type DelClient ¶
type DelClient struct {
Client []string `arg:"" help:"Removes an existing OAuth2 client"`
}
type DeleteCmd ¶
type ExportCmd ¶
type ExportCmd struct {
File string `help:"The path where to output the items, if absent it will be printed to stdout."`
}
type FixCollections ¶
type FixCollections struct{}
func (FixCollections) Run ¶
func (f FixCollections) Run(ctl *Control) error
type GenKeys ¶
type InfoCmd ¶
type ListCmd ¶
type ListCmd struct { Type []vocab.ActivityVocabularyType `help:"The type of ActivityPub object to list" default:"${defaultObjectTypes}"` Output string `help:"The format in which to output the items." enum:"text,json" default:"text"` IRIs []vocab.IRI `arg:"" name:"iris"` }
type Maintenance ¶
type Maintenance struct{}
func (Maintenance) Run ¶
func (m Maintenance) Run(ctl *Control) error
type MoveCmd ¶
type Pub ¶
type Pub struct { Actors ActorsCmd `cmd:"" name:"actor" help:"Actor management helper."` Add AddCmd `cmd:"" name:"add" help:"Adds a new object."` List ListCmd `cmd:"" help:"Lists objects."` Info InfoCmd `cmd:"" help:"Show information about an object."` Delete DeleteCmd `cmd:"" help:"Deletes an ActivityPub object."` Move MoveCmd `cmd:"" help:"Move ActivityPub objects to a new collection."` Copy CopyCmd `cmd:"" help:"Copy ActivityPub objects."` Index IndexCmd `cmd:"" help:"Reindex current storage ActivityPub objects."` Export ExportCmd `cmd:"" help:"Exports ActivityPub objects."` Import ImportCmd `cmd:"" help:"Imports ActivityPub objects."` }
type Run ¶
type Run struct { Wait time.Duration `help:"The duration for which the server waits for existing connections to finish" default:"${defaultWaitDuration}"` Env env.Type `enum:"${envTypes}" help:"The environment to use. Expected values: ${envTypes}" default:"${defaultEnv}"` Path string `path:"" help:"The path for the storage folder." default:"." env:"STORAGE_PATH"` Profile bool `hidden:""` Version kong.VersionFlag `short:"V"` }
type Storage ¶
type Storage struct { Type config.StorageType `help:"Type of the backend to use. Possible values: ${storageTypes}"` Bootstrap BootstrapCmd `cmd:""` Reset ResetCmd `cmd:"" help:"Reset an existing storage."` FixCollections FixCollections `cmd:"" help:"Fix storage collections."` }
Click to show internal directories.
Click to hide internal directories.