Documentation ¶
Index ¶
- Constants
- Variables
- type File
- type Gost
- func (g *Gost) Create() error
- func (g *Gost) FindFile(fileId string) *File
- func (g *Gost) GetGostById(id string) error
- func (g *Gost) GetGostsByUsername(username string) ([]Gost, error)
- func (g *Gost) IgnoreEmpty()
- func (g *Gost) Remove(isUser bool) error
- func (g *Gost) Validate() bool
- func (g *Gost) WithUser(user user.User)
Constants ¶
View Source
const ( // STATUSWELL mean gost can be show STATUSWELL = 1 + iota // STATUSDELETEDBYUSER mean gost is already deleted by user STATUSDELETEDBYUSER // STATUSDELETEDBYSYSTEM mean gost is already deleted by system STATUSDELETEDBYSYSTEM )
Variables ¶
View Source
var (
// MaxFilesCount is max files count allowed
MaxFilesCount = 10
)
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // ID is uuid of file ID string `json:"id"` // Filename is the file name Filename string `json:"filename"` // Content is file content Content string `json:"content"` }
File is gost file struct
type Gost ¶
type Gost struct { // ID is gost uuid ID string `json:"id"` // Public is if the gost is public Public bool `json:"public"` // Description is gost description message Description string `json:"description"` // Version is gost version Version int `json:"version"` // Files is files contained by gost Files []*File `bson:"filesArray" json:"files"` // CreatedAt is gost created time CreatedAt string `json:"created_at"` // User is gost owner user User user.User `json:"user"` // Status is gost status Status int `json:"-"` }
Gost is struct for gost
func NewDefaultGost ¶
NewDefaultGost create gost with some default fields
func (*Gost) GetGostById ¶
GetGostById find a gost from db by id
func (*Gost) GetGostsByUsername ¶
GetGostsByUsername find gosts from db by author name
func (*Gost) IgnoreEmpty ¶ added in v0.2.6
func (g *Gost) IgnoreEmpty()
IgnoreEmpty will ignore empty file
Click to show internal directories.
Click to hide internal directories.