Documentation
¶
Index ¶
- Variables
- type Account
- func (a *Account) GetActorURI() (actorURI string)
- func (a *Account) GetDisplayName() (displayName string)
- func (a *Account) GetID() (accountID int64)
- func (a *Account) GetInstance() (instance fedihelper.Instance)
- func (a *Account) GetLastFinger() (lastFinger time.Time)
- func (a *Account) GetUsername() (username string)
- func (a *Account) SetActorURI(actorURI string)
- func (a *Account) SetDisplayName(displayName string)
- func (a *Account) SetInstance(instanceI fedihelper.Instance)
- func (a *Account) SetLastFinger(lastFinger time.Time)
- func (a *Account) SetUsername(username string)
- type AccountConfigMap
- type Block
- type Change
- type Config
- func (c *Config) GetValue() (string, error)
- func (c *Config) GetValueBool() (bool, error)
- func (c *Config) GetValueInt() (int, error)
- func (c *Config) SetValue(value string, encrypt bool) error
- func (c *Config) SetValueBool(value bool, encrypt bool) error
- func (c *Config) SetValueInt(value int, encrypt bool) error
- type ConfigChange
- type ConfigKey
- type ConfigMap
- type Error
- type EventType
- type Instance
- func (i *Instance) GetActorURI() (actorURI string)
- func (i *Instance) GetDomain() (domain string)
- func (i *Instance) GetID() (instanceID int64)
- func (i *Instance) GetOAuthClientID() (clientID string)
- func (i *Instance) GetOAuthClientSecret() (string, error)
- func (i *Instance) GetPrivateKey() (*rsa.PrivateKey, error)
- func (i *Instance) GetServerHostname() (hostname string)
- func (i *Instance) GetSoftware() (software string)
- func (i *Instance) PublicKeyPEM() (string, error)
- func (i *Instance) SetActorURI(actorURI string)
- func (i *Instance) SetDomain(domain string)
- func (i *Instance) SetInboxURI(inboxURI string)
- func (i *Instance) SetOAuthClientID(clientID string)
- func (i *Instance) SetOAuthClientSecret(clientSecret string) error
- func (i *Instance) SetPrivateKey(key *rsa.PrivateKey) error
- func (i *Instance) SetServerHostname(hostname string)
- func (i *Instance) SetSoftware(software string)
- type NotificationService
Constants ¶
This section is empty.
Variables ¶
var Changes = []Change{ ChangeAdd, ChangeDelete, ChangeUpdate, }
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID int64 `validate:"-" bun:"id,pk,autoincrement"`
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
ActorURI string `validate:"url" bun:",nullzero,notnull"`
Username string `validate:"-" bun:",unique:unique_fedi_user,nullzero,notnull"`
InstanceID int64 `validate:"-" bun:",unique:unique_fedi_user,nullzero,notnull"`
Instance *Instance `validate:"-" bun:"rel:belongs-to,join:instance_id=id"`
DisplayName string `validate:"-" bun:",nullzero"`
LastFinger time.Time `validate:"-" bun:",notnull"`
LogInCount int64 `validate:"-" bun:",notnull"`
LogInLast time.Time `validate:"-" bun:",nullzero"`
IsAdmin bool `validate:"-" bun:",notnull"`
IsMod bool `validate:"-" bun:",notnull"`
}
Account represents a federated social account.
func (*Account) GetActorURI ¶
GetActorURI returns the account's actor uri.
func (*Account) GetDisplayName ¶
GetDisplayName returns the account's display name.
func (*Account) GetInstance ¶
func (a *Account) GetInstance() (instance fedihelper.Instance)
GetInstance returns the instance of the account.
func (*Account) GetLastFinger ¶
GetLastFinger returns the time of the last finger.
func (*Account) GetUsername ¶
GetUsername returns the account's username.
func (*Account) SetActorURI ¶
SetActorURI sets the account's actor uri.
func (*Account) SetDisplayName ¶
SetDisplayName sets the account's display name.
func (*Account) SetInstance ¶
func (a *Account) SetInstance(instanceI fedihelper.Instance)
SetInstance sets the instance of the account.
func (*Account) SetLastFinger ¶
SetLastFinger sets the time of the last finger.
func (*Account) SetUsername ¶
SetUsername sets the account's username.
type AccountConfigMap ¶ added in v0.2.0
type Block ¶
type Block struct {
ID int64 `validate:"-" bun:",pk,autoincrement,nullzero,notnull,unique" json:"-"`
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp" json:"-"`
UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp" json:"-"`
MarkedForDeletionOn time.Time `validate:"-" bun:",nullzero" json:"-"`
Domain string `validate:"required,fqdn" bun:",nullzero,notnull,unique" json:"domain"`
ObfuscatedDomain string `validate:"-" bun:",nullzero" json:"obfuscated_domain,omitempty"`
BlockSubdomains bool `validate:"-" bun:",notnull" json:"block_subdomains"`
}
Block represents a block of a domain
type Config ¶
type Config struct {
ID int64 `validate:"-" bun:"id,pk,autoincrement"`
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
Key ConfigKey `validate:"-" bun:",unique,nullzero,notnull"`
Value string `validate:"-" bun:",nullzero"`
IsEncrypted bool `validate:"-" bun:",notnull"`
AccountID int64 `validate:"-" bun:",nullzero"`
Account *Account `validate:"-" bun:"rel:belongs-to,join:account_id=id"`
}
Config represents a federated social account.
func (*Config) GetValueBool ¶ added in v0.2.0
func (*Config) GetValueInt ¶
func (*Config) SetValueBool ¶ added in v0.2.0
type ConfigChange ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents a logic specific error.
type Instance ¶
type Instance struct {
ID int64 `validate:"-" bun:",pk,autoincrement,nullzero,notnull,unique"`
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
Domain string `validate:"required,fqdn" bun:",nullzero,notnull,unique"`
ServerHostname string `validate:"required,fqdn" bun:",nullzero,notnull,unique"`
Software string `validate:"-" bun:",nullzero"`
PublicKey *rsa.PublicKey `validate:"-"`
PrivateKey string `validate:"-" bun:",nullzero"`
ActorIRI string `validate:"required,url" bun:",nullzero,notnull,unique"`
InboxIRI string `validate:"required,url" bun:",nullzero,notnull,unique"`
IsFollowing bool `validate:"-" bun:",notnull"`
OAuthClientID string `validate:"-" bun:",nullzero"`
OAuthClientSecret string `validate:"-" bun:",nullzero"`
BlockID int64 `validate:"-" bun:",nullzero"`
Block *Block `validate:"-" bun:"rel:belongs-to"`
}
Instance represents a federated social instance
func (*Instance) GetActorURI ¶
func (*Instance) GetOAuthClientID ¶
func (*Instance) GetOAuthClientSecret ¶
GetOAuthClientSecret returns unencrypted client secret.
func (*Instance) GetPrivateKey ¶
func (i *Instance) GetPrivateKey() (*rsa.PrivateKey, error)
GetPrivateKey returns unencrypted client secret.
func (*Instance) GetServerHostname ¶
func (*Instance) GetSoftware ¶
func (*Instance) PublicKeyPEM ¶
PublicKeyPEM returns a PEM string from the public key.
func (*Instance) SetActorURI ¶
func (*Instance) SetInboxURI ¶
func (*Instance) SetOAuthClientID ¶
func (*Instance) SetOAuthClientSecret ¶
SetOAuthClientSecret sets encrypted client secret.
func (*Instance) SetPrivateKey ¶
func (i *Instance) SetPrivateKey(key *rsa.PrivateKey) error
SetPrivateKey sets encrypted client secret.
func (*Instance) SetServerHostname ¶
func (*Instance) SetSoftware ¶
type NotificationService ¶ added in v0.2.0
type NotificationService string
const (
ServiceTelegram NotificationService = "telegram"
)