Documentation
¶
Index ¶
- Constants
- type Block
- type FediAccount
- func (f *FediAccount) BeforeAppendModel(_ context.Context, query bun.Query) error
- func (f *FediAccount) GetActorURI() (actorURI string)
- func (f *FediAccount) GetDisplayName() (displayName string)
- func (f *FediAccount) GetID() (accountID int64)
- func (f *FediAccount) GetInstance() (instance fedihelper.Instance)
- func (f *FediAccount) GetLastFinger() (lastFinger time.Time)
- func (f *FediAccount) GetUsername() (username string)
- func (f *FediAccount) SetActorURI(actorURI string)
- func (f *FediAccount) SetDisplayName(displayName string)
- func (f *FediAccount) SetInstance(instanceI fedihelper.Instance)
- func (f *FediAccount) SetLastFinger(lastFinger time.Time)
- func (f *FediAccount) SetUsername(username string)
- type FediInstance
- func (f *FediInstance) BeforeAppendModel(_ context.Context, query bun.Query) error
- func (f *FediInstance) GetActorURI() (actorURI string)
- func (f *FediInstance) GetDomain() (domain string)
- func (f *FediInstance) GetID() (instanceID int64)
- func (f *FediInstance) GetServerHostname() (hostname string)
- func (f *FediInstance) GetSoftware() (software string)
- func (f *FediInstance) SetActorURI(actorURI string)
- func (f *FediInstance) SetDomain(domain string)
- func (f *FediInstance) SetServerHostname(hostname string)
- func (f *FediInstance) SetSoftware(software string)
- type Transaction
- type TransactionCouncilInit
- type TransactionCouncilInitMember
- type TransactionType
Constants ¶
const ( TransactionTypeCouncilInit TransactionType = "COUNCIL_INIT" TransactionTypeCouncilInitString string = "Council initialized with members: %s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FediAccount ¶
type FediAccount 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 *FediInstance `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"`
IsCouncil bool `validate:"-" bun:",notnull"`
}
FediAccount represents a federated social account.
func (*FediAccount) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*FediAccount) GetActorURI ¶
func (f *FediAccount) GetActorURI() (actorURI string)
GetActorURI returns the account's actor uri.
func (*FediAccount) GetDisplayName ¶
func (f *FediAccount) GetDisplayName() (displayName string)
GetDisplayName returns the account's display name.
func (*FediAccount) GetID ¶
func (f *FediAccount) GetID() (accountID int64)
GetID returns the account's database id.
func (*FediAccount) GetInstance ¶
func (f *FediAccount) GetInstance() (instance fedihelper.Instance)
GetInstance returns the instance of the account.
func (*FediAccount) GetLastFinger ¶
func (f *FediAccount) GetLastFinger() (lastFinger time.Time)
GetLastFinger returns the time of the last finger.
func (*FediAccount) GetUsername ¶
func (f *FediAccount) GetUsername() (username string)
GetUsername returns the account's username.
func (*FediAccount) SetActorURI ¶
func (f *FediAccount) SetActorURI(actorURI string)
SetActorURI sets the account's actor uri.
func (*FediAccount) SetDisplayName ¶
func (f *FediAccount) SetDisplayName(displayName string)
SetDisplayName sets the account's display name.
func (*FediAccount) SetInstance ¶
func (f *FediAccount) SetInstance(instanceI fedihelper.Instance)
SetInstance sets the instance of the account.
func (*FediAccount) SetLastFinger ¶
func (f *FediAccount) SetLastFinger(lastFinger time.Time)
SetLastFinger sets the time of the last finger.
func (*FediAccount) SetUsername ¶
func (f *FediAccount) SetUsername(username string)
SetUsername sets the account's username.
type FediInstance ¶
type FediInstance 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"`
Domain string `validate:"-" bun:",nullzero,notnull,unique"`
ActorURI string `validate:"url" bun:",nullzero,notnull"`
ServerHostname string `validate:"-" bun:",nullzero,notnull,unique"`
Software string `validate:"-" bun:",nullzero,notnull"`
}
FediInstance represents a federated social instance.
func (*FediInstance) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*FediInstance) GetActorURI ¶
func (f *FediInstance) GetActorURI() (actorURI string)
func (*FediInstance) GetDomain ¶
func (f *FediInstance) GetDomain() (domain string)
func (*FediInstance) GetID ¶
func (f *FediInstance) GetID() (instanceID int64)
func (*FediInstance) GetServerHostname ¶
func (f *FediInstance) GetServerHostname() (hostname string)
func (*FediInstance) GetSoftware ¶
func (f *FediInstance) GetSoftware() (software string)
func (*FediInstance) SetActorURI ¶
func (f *FediInstance) SetActorURI(actorURI string)
func (*FediInstance) SetDomain ¶
func (f *FediInstance) SetDomain(domain string)
func (*FediInstance) SetServerHostname ¶
func (f *FediInstance) SetServerHostname(hostname string)
func (*FediInstance) SetSoftware ¶
func (f *FediInstance) SetSoftware(software string)
type Transaction ¶
type Transaction struct {
ID int64 `validate:"-" bun:"id,pk,autoincrement"`
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"`
Type TransactionType `validate:"-" bun:",nullzero,notnull"`
MetaData string `validate:"-" bun:",nullzero,notnull"`
}
Transaction represents a transaction lgo entry.
func (*Transaction) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*Transaction) GetMetaData ¶
func (t *Transaction) GetMetaData(i interface{}) error
GetMetaData marshals metadata into json and adds it to transaction.
func (*Transaction) SetMetaData ¶
func (t *Transaction) SetMetaData(i interface{}) error
SetMetaData marshals metadata into json and adds it to transaction.
type TransactionCouncilInit ¶
type TransactionCouncilInit struct {
Members []TransactionCouncilInitMember `json:"members"`
}
func (*TransactionCouncilInit) String ¶
func (t *TransactionCouncilInit) String() string
type TransactionType ¶
type TransactionType string