dash

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VoteDown is a negative Vote-Type
	VoteDown = -1
	// VoteUp is a positive Vote-Type
	VoteUp = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID                int        `json:"id"`
	Title             string     `json:"title"`
	Body              string     `json:"-"`
	BodyRendered      string     `json:"-"`
	Public            bool       `json:"public"`
	Type              string     `json:"type"`
	Teams             []string   `json:"teams"`
	Identifier        Identifier `json:"-"`
	IdentifierID      int        `json:"-"`
	Anchor            string     `json:"anchor"`
	UserID            int        `json:"-"`
	AuthorUsername    string     `json:"-"`
	Score             int        `json:"score"`
	RemovedFromPublic bool       `json:"-"`
	UpdatedAt         time.Time  `json:"updated_at"`
	CreatedAt         time.Time  `json:"created_at"`
}

type Identifier

type Identifier struct {
	ID               int       `json:"-"`
	BannedFromPublic bool      `json:"-"`
	DocsetName       string    `json:"docset_name"`
	DocsetFilename   string    `json:"docset_filename"`
	DocsetPlatform   string    `json:"docset_platform"`
	DocsetBundle     string    `json:"docset_bundle"`
	DocsetVersion    string    `json:"docset_version"`
	PagePath         string    `json:"page_path"`
	PageTitle        string    `json:"page_title"`
	HttrackSource    string    `json:"httrack_source"`
	UpdatedAt        time.Time `json:"updated_at"`
	CreatedAt        time.Time `json:"created_at"`
}

Identifier represents the location within docsets. It's used to allow annotations to reference a specific location

func (Identifier) IsEmpty

func (dict Identifier) IsEmpty() bool

type Team

type Team struct {
	ID                 int
	Name               string
	EncryptedAccessKey string
	OwnerID            int
	CreatedAt          time.Time
	UpdatedAt          time.Time
}

func (*Team) AccessKeysMatch

func (t *Team) AccessKeysMatch(accessKey string) bool

func (*Team) ChangeAccessKey

func (t *Team) ChangeAccessKey(newKey string)

type TeamMember

type TeamMember struct {
	TeamID   int    `json:"-"`
	TeamName string `json:"name"`
	Role     string `json:"role"`
	UserID   int    `json:"-"`
}

type User

type User struct {
	ID                int
	Username          string
	Email             sql.NullString
	EncryptedPassword string
	RememberToken     sql.NullString
	TeamMemberships   []TeamMember
	Moderator         bool
	UpdatedAt         time.Time
	CreatedAt         time.Time
}

func (*User) ChangePassword

func (u *User) ChangePassword(newPassword string)

func (*User) PasswordsMatch

func (u *User) PasswordsMatch(password string) bool

type Vote

type Vote struct {
	ID        int
	Type      int
	EntryID   int
	UserID    int
	UpdatedAt time.Time
	CreatedAt time.Time
}

Vote identifies that a user either up- or downvoted an entry

func (*Vote) IsDownvote

func (v *Vote) IsDownvote() bool

IsDownvote is a predicate testing for VoteDown types

func (*Vote) IsUpvote

func (v *Vote) IsUpvote() bool

IsUpvote is a predicate testing for VoteUp types

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL