Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationToken ¶
type ApplicationToken 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"`
Token string `validate:"-" bun:",nullzero,notnull"`
Description string `validate:"-" bun:",nullzero,notnull"`
CreatedByID int64 `validate:"-" bun:",nullzero,notnull"`
CreatedBy *FediAccount `validate:"-" bun:"rel:belongs-to"`
}
ApplicationToken contains application authentication tokens.
func (*ApplicationToken) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
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:",notnull"`
LastFinger time.Time `validate:"-" bun:",notnull"`
LogInCount int64 `validate:"-" bun:",nullzero,notnull,default:0"`
LogInLast time.Time `validate:"-" bun:",nullzero"`
AccessToken []byte `validate:"-" bun:",nullzero"`
// login stuff
Admin bool `validate:"-" bun:",notnull"`
}
FediAccount represents a federated social account.
func (*FediAccount) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*FediAccount) GetAccessToken ¶
func (f *FediAccount) GetAccessToken() (string, error)
GetAccessToken returns unencrypted access token.
func (*FediAccount) SetAccessToken ¶
func (f *FediAccount) SetAccessToken(a string) error
SetAccessToken sets encrypted access token.
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"`
ClientID string `validate:"-" bun:",nullzero"`
ClientSecret []byte `validate:"-" bun:",nullzero"`
}
FediInstance represents a federated social instance.
func (*FediInstance) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*FediInstance) GetClientSecret ¶
func (f *FediInstance) GetClientSecret() (string, error)
GetClientSecret returns unencrypted client secret.
func (*FediInstance) SetClientSecret ¶
func (f *FediInstance) SetClientSecret(s string) error
SetClientSecret sets encrypted client secret.
type OauthClient ¶
type OauthClient 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"`
Secret []byte `validate:"-" bun:",nullzero,notnull"`
RedirectURI string `validate:"required,url" bun:",nullzero,notnull"`
Description string `validate:"-" bun:",nullzero,notnull"`
OwnerID int64 `validate:"-" bun:",nullzero,notnull"`
Owner *FediAccount `validate:"-" bun:"rel:belongs-to"`
}
OauthClient contains the oauth clients.
func (*OauthClient) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.
func (*OauthClient) GetSecret ¶
func (f *OauthClient) GetSecret() (string, error)
GetSecret returns unencrypted secret.
func (*OauthClient) SetSecret ¶
func (f *OauthClient) SetSecret(s string) error
SetSecret sets encrypted secret.
type OauthScope ¶
type OauthScope 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"`
Name string `validate:"required" bun:",nullzero,notnull"`
Description string `validate:"-" bun:",nullzero"`
Default bool `validate:"-" bun:",notnull,default:false"`
}
OauthScope contains the oauth scopes.
func (*OauthScope) BeforeAppendModel ¶
BeforeAppendModel runs before a bun append operation.