Documentation
¶
Index ¶
- Variables
- func Delete(ctx context.Context, dbConn *db.MongoDB, id string) error
- func Deleted() func(*ListOpts)
- func EnsureIndex(ctx context.Context, dbConn *db.MongoDB) error
- func Limit(i int) func(*ListOpts)
- func NewListOpts() []func(*ListOpts)
- func Offset(i int) func(*ListOpts)
- func OrgID(s string) func(*ListOpts)
- func Status(s string) func(*ListOpts)
- func Update(ctx context.Context, dbConn *db.MongoDB, id string, upd *Report, now time.Time) error
- func UserID(s string) func(*ListOpts)
- type CmpArticleView
- type CmpArticles
- type CmpHTML
- type CmpMarkdown
- type CmpTags
- type CmpText
- type CmpTimeline
- type Component
- type ComponentFactory
- type ListOpts
- type Pagination
- type Report
- type ReportsList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound abstracts the not found error. ErrNotFound = errors.New("Entity not found") // ErrInvalidID occurs when an ID is not in a valid form. ErrInvalidID = errors.New("ID is not in its proper form") // ErrAuthenticationFailure occurs when a user attempts to authenticate but // anything goes wrong. ErrAuthenticationFailure = errors.New("Authentication failed") // ErrForbidden occurs when a user tries to do something that is forbidden to them according to our access control policies. ErrForbidden = errors.New("Attempted action is not allowed") )
View Source
var Components = make(map[string]ComponentFactory)
Functions ¶
func NewListOpts ¶
func NewListOpts() []func(*ListOpts)
Types ¶
type CmpArticleView ¶
type CmpArticleView struct { Type string `json:"type" default:"article-view"` Body article.Document `json:"body"` }
func (CmpArticleView) Kind ¶
func (c CmpArticleView) Kind() string
func (CmpArticleView) Payload ¶
func (c CmpArticleView) Payload() interface{}
type CmpArticles ¶
type CmpArticles struct { Type string `json:"type" default:"articles"` Body []article.Document `json:"body"` }
func (CmpArticles) Kind ¶
func (c CmpArticles) Kind() string
func (CmpArticles) Payload ¶
func (c CmpArticles) Payload() interface{}
type CmpMarkdown ¶
func (CmpMarkdown) Kind ¶
func (c CmpMarkdown) Kind() string
func (CmpMarkdown) Payload ¶
func (c CmpMarkdown) Payload() interface{}
type CmpTimeline ¶
type CmpTimeline struct { Type string `json:"type" default:"timeline"` Body []article.Document `json:"body"` }
func (CmpTimeline) Kind ¶
func (c CmpTimeline) Kind() string
func (CmpTimeline) Payload ¶
func (c CmpTimeline) Payload() interface{}
type Component ¶
type Component interface { Kind() string Payload() interface{} }
func NewCmpArticleView ¶
func NewCmpArticles ¶
func NewCmpHTML ¶
func NewCmpMarkdown ¶
func NewCmpTags ¶
func NewCmpText ¶
func NewCmpTimeline ¶
type ComponentFactory ¶
type ListOpts ¶
type ListOpts struct { Limit int Offset int Deleted bool OrgID primitive.ObjectID UserID primitive.ObjectID Status string }
func DefaultOpts ¶
func DefaultOpts() ListOpts
type Pagination ¶
type Report ¶
type Report struct { ID primitive.ObjectID `bson:"_id" json:"id"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"` Deleted bool `json:"-" bson:"deleted"` UserID string `json:"-"` OrgID string `json:"-"` Title string `json:"title" bson:"title"` Style string `json:"style"` Articles []article.Document `json:"articles"` Components []Component `json:"components" bson:"components"` }
type ReportsList ¶
type ReportsList struct { Data []*Report `json:"data"` Pagination *Pagination `json:"pagination"` }
ReportsList of Report
Click to show internal directories.
Click to hide internal directories.