🚧 Work on actor object
This commit is contained in:
parent
673b42394c
commit
60131a4701
4 changed files with 152 additions and 32 deletions
|
|
@ -2,6 +2,7 @@ package config
|
|||
|
||||
import (
|
||||
"github.com/BurntSushi/toml"
|
||||
vocab "github.com/go-ap/activitypub"
|
||||
"github.com/kirsle/configdir"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"path/filepath"
|
||||
|
|
@ -53,6 +54,25 @@ type Config struct {
|
|||
Id string `toml:"id"`
|
||||
}
|
||||
|
||||
func (c Config) GetIcon() vocab.IRI {
|
||||
// @todo return a media object, instead of an IRI
|
||||
|
||||
return vocab.IRI(c.IconUrl)
|
||||
}
|
||||
|
||||
func (c Config) GetActor() vocab.Actor {
|
||||
return vocab.Actor{
|
||||
// Id:
|
||||
Name: vocab.NaturalLanguageValues{
|
||||
vocab.LangRefValue{
|
||||
Ref: "en",
|
||||
Value: []byte(c.Name),
|
||||
},
|
||||
},
|
||||
Icon: c.GetIcon(),
|
||||
}
|
||||
}
|
||||
|
||||
var config Config
|
||||
|
||||
func newConfig() Config {
|
||||
|
|
|
|||
Reference in a new issue