Documentation
¶
Index ¶
- func DeleteFromTables(db *gorm.DB)
- func Migrate(db *gorm.DB)
- func ModelSetup(db *gorm.DB)
- type Actor
- func (actor *Actor) GetDomain() string
- func (actor *Actor) GetFollowersURI() string
- func (actor *Actor) GetFollowingURI() string
- func (actor *Actor) GetInboxURI() string
- func (actor *Actor) GetOutboxURI() string
- func (actor *Actor) GetPublicKey() string
- func (actor *Actor) GetPublicKeyURI() string
- func (actor *Actor) GetURI() string
- func (actor *Actor) GetURL() string
- func (actor *Actor) GetUsername() string
- func (actor *Actor) IsBot() bool
- func (actor *Actor) IsCommune() bool
- func (actor *Actor) IsLocal(localDomains []string) bool
- func (actor *Actor) RestChildren() map[string]interface{}
- type Category
- type Follow
- type Post
- func (post *Post) GetActivityCreate() interfaces.IObject
- func (post *Post) GetAuthorURI() string
- func (post *Post) GetContent() string
- func (post *Post) GetDomain() string
- func (post *Post) GetInReplyTo() string
- func (post *Post) GetName() string
- func (post *Post) GetSource() string
- func (post *Post) GetSourceMediaType() string
- func (post *Post) GetURI() string
- func (post *Post) GetURL() string
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFromTables ¶
DeleteFromTables removes all contents in the database!
Types ¶
type Actor ¶
type Actor struct { abstract.Object Username string `json:"preferredUsername"` Domain string `json:"-"` Name string `json:"name"` Summary string `json:"summary"` PublicKey string `json:"-"` FollowersURI string `json:"followers"` FollowingURI string `json:"following"` InboxURI string `json:"inbox"` OutboxURI string `json:"outbox"` CreatedPosts []Post `gorm:"foreignKey:AuthorID"` Followers []*Actor `gorm:"many2many:Follow;joinForeignKey:FollowingID;joinReferences:FollowingID"` Following []*Actor `gorm:"many2many:Follow;joinForeignKey:FollowerID;joinReferences:FollowerID"` User *User Categories []Category `gorm:"foreignKey:CommuneID"` }
Actor is an abstract user either person, bot or a group of people. Don't create table for it.
func (*Actor) GetFollowersURI ¶
func (*Actor) GetFollowingURI ¶
func (*Actor) GetInboxURI ¶
func (*Actor) GetOutboxURI ¶
func (*Actor) GetPublicKey ¶
func (*Actor) GetPublicKeyURI ¶
func (*Actor) GetUsername ¶
func (*Actor) RestChildren ¶
type Post ¶
type Post struct { abstract.Object AuthorID int Author Actor CategoryID *int Category *Category Content string MediaType string Source string SourceMediaType string Name string ReplyToID *int ReplyTo *Post BoostToID *int BoostTo *Post }
Post is a general posting.
func (*Post) GetActivityCreate ¶
func (post *Post) GetActivityCreate() interfaces.IObject
func (*Post) GetAuthorURI ¶
func (*Post) GetContent ¶
func (*Post) GetInReplyTo ¶
func (*Post) GetSourceMediaType ¶
type User ¶
type User struct { ActorID int `gorm:"primaryKey;autoIncrement:false;"` Actor Actor `gorm:"foreignKey:ActorID"` Email *string `gorm:"unique"` EncryptedPassword string PrivateKey string IsVerified bool IsAdmin bool IsModerator bool }
User is the private part of a local account.
func NewLocalCommune ¶
NewLocalCommune creates a new User struct without insert it into database.
func (*User) Authenticate ¶
Authenticate uses bcrypt for now.
Click to show internal directories.
Click to hide internal directories.