valueobject

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnoughTime

func EnoughTime(key string, cb func(key string) error) bool

func GetIdFromQueryString

func GetIdFromQueryString(queryString string) (string, error)

func Hash added in v0.1.0

func Hash(fields []string) string

func Slug added in v0.1.0

func Slug(i content.Identifiable) (string, error)

Slug returns a URL friendly string from the title of a post item

func StringToSlug added in v0.1.0

func StringToSlug(s string) (string, error)

Types

type Author

type Author struct {
	Item

	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	SiteURL   string `json:"site_url"`
	Avatar    string `json:"avatar"`
}

func (*Author) AfterAPICreate

func (s *Author) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Author) Approve

func (s *Author) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Author) AutoApprove

func (s *Author) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Author) BeforeAPICreate

func (s *Author) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Author) Create

func (s *Author) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Author) IndexContent

func (s *Author) IndexContent() bool

func (*Author) MarshalEditor

func (s *Author) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Author) String

func (s *Author) String() string

String defines the display name of a Song in the CMS list-view

type Deployment added in v0.1.0

type Deployment struct {
	Item

	Domain string `json:"domain"`

	SiteID   string `json:"site_id"`
	SiteName string `json:"site_name"`
	SitePath string `json:"site_path"`
	HostName string `json:"host_name"`

	Status string `json:"status"`
	// contains filtered or unexported fields
}

func (*Deployment) AfterAPICreate added in v0.1.0

func (s *Deployment) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Deployment) Approve added in v0.1.0

func (s *Deployment) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Deployment) AutoApprove added in v0.1.0

func (s *Deployment) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Deployment) BeforeAPICreate added in v0.1.0

func (s *Deployment) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Deployment) Create added in v0.1.0

func (s *Deployment) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Deployment) IndexContent added in v0.1.0

func (s *Deployment) IndexContent() bool

func (*Deployment) MarshalEditor added in v0.1.0

func (s *Deployment) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Deployment) SelectContentTypes added in v0.1.0

func (s *Deployment) SelectContentTypes() []string

func (*Deployment) SetHash added in v0.1.0

func (s *Deployment) SetHash()

func (*Deployment) SetSelectData added in v0.1.0

func (s *Deployment) SetSelectData(data map[string][][]byte)

func (*Deployment) String added in v0.1.0

func (s *Deployment) String() string

String defines the display name of a Song in the CMS list-view

type Domain added in v0.0.5

type Domain struct {
	Item

	Root  string `json:"root"`
	Sub   string `json:"sub"`
	Owner string `json:"owner"`
}

func (*Domain) AfterAPICreate added in v0.0.5

func (d *Domain) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Domain) Approve added in v0.0.5

func (d *Domain) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Domain) AutoApprove added in v0.0.5

func (d *Domain) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Domain) BeforeAPICreate added in v0.0.5

func (d *Domain) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Domain) Create added in v0.0.5

func (d *Domain) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Domain) FullDomain added in v0.1.0

func (d *Domain) FullDomain() string

func (*Domain) IndexContent added in v0.1.0

func (d *Domain) IndexContent() bool

func (*Domain) MarshalEditor added in v0.0.5

func (d *Domain) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Domain) Name added in v0.0.5

func (d *Domain) Name() string

func (*Domain) SetHash added in v0.1.0

func (d *Domain) SetHash()

func (*Domain) String added in v0.0.5

func (d *Domain) String() string

String defines the display name of a Song in the CMS list-view

type File added in v0.0.5

type File struct {
	Fs      afero.Fs
	Path    string
	Content []byte
}

func (*File) Dump added in v0.0.5

func (f *File) Dump() error

type Index

type Index struct {
	// contains filtered or unexported fields
}

func CreateIndex

func CreateIndex(target string) *Index

func NewIndex

func NewIndex(ns, id string) *Index

func (*Index) ContentType

func (i *Index) ContentType() string

func (*Index) ID

func (i *Index) ID() string

func (*Index) Namespace

func (i *Index) Namespace() string

func (*Index) String

func (i *Index) String() string

type Item

type Item struct {
	UUID      uuid.UUID      `json:"uuid"`
	Status    content.Status `json:"status"`
	Namespace string         `json:"namespace"`
	ID        int            `json:"id"`
	Slug      string         `json:"slug"`
	Hash      string         `json:"hash"`
	Timestamp int64          `json:"timestamp"`
	Updated   int64          `json:"updated"`
}

Item should only be embedded into content type structs.

func NewItem

func NewItem() (*Item, error)

func NewItemWithNamespace

func NewItemWithNamespace(namespace string) (*Item, error)

func (*Item) AfterAPICreate

func (i *Item) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAPIDelete

func (i *Item) AfterAPIDelete(res http.ResponseWriter, req *http.Request) error

AfterAPIDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAPIResponse

func (i *Item) AfterAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) error

AfterAPIResponse is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAPIUpdate

func (i *Item) AfterAPIUpdate(res http.ResponseWriter, req *http.Request) error

AfterAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAdminCreate

func (i *Item) AfterAdminCreate(res http.ResponseWriter, req *http.Request) error

AfterAdminCreate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAdminDelete

func (i *Item) AfterAdminDelete(res http.ResponseWriter, req *http.Request) error

AfterAdminDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterAdminUpdate

func (i *Item) AfterAdminUpdate(res http.ResponseWriter, req *http.Request) error

AfterAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterApprove

func (i *Item) AfterApprove(res http.ResponseWriter, req *http.Request) error

AfterApprove is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterDelete

func (i *Item) AfterDelete(res http.ResponseWriter, req *http.Request) error

AfterDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterDisable

func (i *Item) AfterDisable(res http.ResponseWriter, req *http.Request) error

AfterDisable is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterEnable

func (i *Item) AfterEnable(res http.ResponseWriter, req *http.Request) error

AfterEnable is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterReject

func (i *Item) AfterReject(res http.ResponseWriter, req *http.Request) error

AfterReject is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) AfterSave

func (i *Item) AfterSave(res http.ResponseWriter, req *http.Request) error

AfterSave is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAPICreate

func (i *Item) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAPIDelete

func (i *Item) BeforeAPIDelete(res http.ResponseWriter, req *http.Request) error

BeforeAPIDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAPIResponse

func (i *Item) BeforeAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) ([]byte, error)

BeforeAPIResponse is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAPIUpdate

func (i *Item) BeforeAPIUpdate(res http.ResponseWriter, req *http.Request) error

BeforeAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAdminCreate

func (i *Item) BeforeAdminCreate(res http.ResponseWriter, req *http.Request) error

BeforeAdminCreate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAdminDelete

func (i *Item) BeforeAdminDelete(res http.ResponseWriter, req *http.Request) error

BeforeAdminDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeAdminUpdate

func (i *Item) BeforeAdminUpdate(res http.ResponseWriter, req *http.Request) error

BeforeAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeApprove

func (i *Item) BeforeApprove(res http.ResponseWriter, req *http.Request) error

BeforeApprove is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeDelete

func (i *Item) BeforeDelete(res http.ResponseWriter, req *http.Request) error

BeforeDelete is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeDisable

func (i *Item) BeforeDisable(res http.ResponseWriter, req *http.Request) error

BeforeDisable is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeEnable

func (i *Item) BeforeEnable(res http.ResponseWriter, req *http.Request) error

BeforeEnable is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeReject

func (i *Item) BeforeReject(res http.ResponseWriter, req *http.Request) error

BeforeReject is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) BeforeSave

func (i *Item) BeforeSave(res http.ResponseWriter, req *http.Request) error

BeforeSave is a no-op to ensure structs which embed *Item implement Hookable

func (*Item) IndexContent

func (i *Item) IndexContent() bool

IndexContent determines if a type should be indexed for searching partially implements search.Searchable

func (*Item) ItemHash added in v0.1.0

func (i *Item) ItemHash() string

ItemHash gets the item's hash

func (*Item) ItemID

func (i *Item) ItemID() int

ItemID gets the *Item's ID field partially implements the Identifiable interface

func (*Item) ItemName

func (i *Item) ItemName() string

ItemName gets the *Item's Namespace field partially implements the Identifiable interface

func (*Item) ItemSlug

func (i *Item) ItemSlug() string

ItemSlug sets the item's slug for its URL

func (*Item) ItemStatus

func (i *Item) ItemStatus() content.Status

ItemStatus gets the *Item's Status field partially implements the Identifiable interface

func (*Item) QueryString

func (i *Item) QueryString() string

func (*Item) SearchMapping

func (i *Item) SearchMapping() (*mapping.IndexMappingImpl, error)

SearchMapping returns a default implementation of a Bleve IndexMappingImpl partially implements search.Searchable

func (*Item) SetItemID

func (i *Item) SetItemID(id int)

SetItemID sets the *Item's ID field partially implements the Identifiable interface

func (*Item) SetItemStatus

func (i *Item) SetItemStatus(status content.Status)

SetItemStatus sets the *Item's Status field partially implements the Identifiable interface

func (*Item) SetSlug

func (i *Item) SetSlug(slug string)

SetSlug sets the item's slug for its URL

func (*Item) SetUniqueID

func (i *Item) SetUniqueID(uuid uuid.UUID)

func (*Item) String

func (i *Item) String() string

String formats an *Item into a printable value partially implements the Identifiable interface

func (*Item) Time

func (i *Item) Time() int64

Time partially implements the Sortable interface

func (*Item) Touch

func (i *Item) Touch() int64

Touch partially implements the Sortable interface

func (*Item) UniqueID

func (i *Item) UniqueID() uuid.UUID

UniqueID gets the *Item's UUID field partially implements the Identifiable interface

func (*Item) UpdateTime

func (i *Item) UpdateTime() time.Time

type Language

type Language struct {
	Item

	Name string `json:"name"`
	Code string `json:"code"`
}

func (*Language) Approve

func (a *Language) Approve(http.ResponseWriter, *http.Request) error

func (*Language) Create

func (a *Language) Create(res http.ResponseWriter, req *http.Request) error

func (*Language) IndexContent

func (a *Language) IndexContent() bool

func (*Language) MarshalEditor

func (a *Language) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Artist within the CMS and implements editor.Editable

func (*Language) SetHash added in v0.1.0

func (a *Language) SetHash()

func (*Language) String

func (a *Language) String() string

String defines how a Artist is printed. Update it using more descriptive fields from the Artist struct type

type Post

type Post struct {
	Item

	Title   string   `json:"title"`
	Content string   `json:"content"`
	Author  string   `json:"author"`
	Params  string   `json:"params"`
	Assets  []string `json:"assets"`
}

func (*Post) AfterAPICreate

func (s *Post) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Post) Approve

func (s *Post) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Post) AutoApprove

func (s *Post) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Post) BeforeAPICreate

func (s *Post) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Post) Create

func (s *Post) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Post) FrontMatter

func (s *Post) FrontMatter() string

func (*Post) FullContent

func (s *Post) FullContent() string

func (*Post) IndexContent

func (s *Post) IndexContent() bool

func (*Post) Markdown added in v0.0.5

func (s *Post) Markdown() ([]byte, error)

func (*Post) MarshalEditor

func (s *Post) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Post) Push

func (s *Post) Push(http.ResponseWriter, *http.Request) ([]string, error)

func (*Post) String

func (s *Post) String() string

String defines the display name of a Song in the CMS list-view

type Resource added in v0.0.13

type Resource struct {
	Item

	Name  string `json:"name"`
	Asset string `json:"asset"`
}

func (*Resource) AfterAPICreate added in v0.0.13

func (s *Resource) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Resource) Approve added in v0.0.13

func (s *Resource) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Resource) AutoApprove added in v0.0.13

func (s *Resource) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Resource) BeforeAPICreate added in v0.0.13

func (s *Resource) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Resource) Create added in v0.0.13

func (s *Resource) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Resource) IndexContent added in v0.0.13

func (s *Resource) IndexContent() bool

func (*Resource) MarshalEditor added in v0.0.13

func (s *Resource) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Resource) String added in v0.0.13

func (s *Resource) String() string

String defines the display name of a Song in the CMS list-view

type Site

type Site struct {
	Item

	Title       string   `json:"title"`
	Description string   `json:"description"`
	BaseURL     string   `json:"base_url"`
	Theme       string   `json:"theme"`
	Params      string   `json:"params"`
	Owner       string   `json:"owner"`
	WorkingDir  string   `json:"working_dir"`
	Languages   []string `json:"languages"`
	Menus       []string `json:"menus"`
}

func (*Site) AfterAPICreate

func (s *Site) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Site) Approve

func (s *Site) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Site) AutoApprove

func (s *Site) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Site) BeforeAPICreate

func (s *Site) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Site) Build

func (s *Site) Build() bool

func (*Site) Create

func (s *Site) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Site) Deploy

func (s *Site) Deploy() bool

func (*Site) HasMenus added in v0.1.1

func (s *Site) HasMenus() bool

func (*Site) IndexContent

func (s *Site) IndexContent() bool

func (*Site) IsMultiLanguages added in v0.1.1

func (s *Site) IsMultiLanguages() bool

func (*Site) MarshalEditor

func (s *Site) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Site) String

func (s *Site) String() string

String defines the display name of a Song in the CMS list-view

func (*Site) Toml added in v0.0.5

func (s *Site) Toml() ([]byte, error)

func (*Site) UnmarshalJSON added in v0.1.1

func (s *Site) UnmarshalJSON(data []byte) error

type SiteLanguage

type SiteLanguage struct {
	Item

	Site     string `json:"site"`
	Language string `json:"language"`
	Default  bool   `json:"default"`
	Folder   string `json:"folder"`
	// contains filtered or unexported fields
}

func (*SiteLanguage) AfterAPICreate

func (s *SiteLanguage) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*SiteLanguage) Approve

func (s *SiteLanguage) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*SiteLanguage) AutoApprove

func (s *SiteLanguage) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*SiteLanguage) BeforeAPICreate

func (s *SiteLanguage) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*SiteLanguage) Create

func (s *SiteLanguage) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*SiteLanguage) IndexContent

func (s *SiteLanguage) IndexContent() bool

func (*SiteLanguage) MarshalEditor

func (s *SiteLanguage) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*SiteLanguage) SelectContentTypes

func (s *SiteLanguage) SelectContentTypes() []string

func (*SiteLanguage) SetSelectData

func (s *SiteLanguage) SetSelectData(data map[string][][]byte)

func (*SiteLanguage) String

func (s *SiteLanguage) String() string

String defines the display name of a Song in the CMS list-view

type SitePost

type SitePost struct {
	Item

	Site string `json:"site"`
	Post string `json:"post"`
	Path string `json:"path"`
	// contains filtered or unexported fields
}

func (*SitePost) AfterAPICreate

func (s *SitePost) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*SitePost) Approve

func (s *SitePost) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*SitePost) AutoApprove

func (s *SitePost) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*SitePost) BeforeAPICreate

func (s *SitePost) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*SitePost) Create

func (s *SitePost) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*SitePost) IndexContent

func (s *SitePost) IndexContent() bool

func (*SitePost) MarshalEditor

func (s *SitePost) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*SitePost) SelectContentTypes

func (s *SitePost) SelectContentTypes() []string

func (*SitePost) SetSelectData

func (s *SitePost) SetSelectData(data map[string][][]byte)

func (*SitePost) String

func (s *SitePost) String() string

String defines the display name of a Song in the CMS list-view

type SiteResource added in v0.0.13

type SiteResource struct {
	Item

	Site     string `json:"site"`
	Resource string `json:"resource"`
	Path     string `json:"path"`
	// contains filtered or unexported fields
}

func (*SiteResource) AfterAPICreate added in v0.0.13

func (s *SiteResource) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*SiteResource) Approve added in v0.0.13

func (s *SiteResource) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*SiteResource) AutoApprove added in v0.0.13

func (s *SiteResource) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*SiteResource) BeforeAPICreate added in v0.0.13

func (s *SiteResource) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*SiteResource) Create added in v0.0.13

func (s *SiteResource) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*SiteResource) IndexContent added in v0.0.13

func (s *SiteResource) IndexContent() bool

func (*SiteResource) MarshalEditor added in v0.0.13

func (s *SiteResource) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*SiteResource) SelectContentTypes added in v0.0.13

func (s *SiteResource) SelectContentTypes() []string

func (*SiteResource) SetSelectData added in v0.0.13

func (s *SiteResource) SetSelectData(data map[string][][]byte)

func (*SiteResource) String added in v0.0.13

func (s *SiteResource) String() string

String defines the display name of a Song in the CMS list-view

type SortableContent

type SortableContent []content.Sortable

func (SortableContent) Len

func (s SortableContent) Len() int

func (SortableContent) Less

func (s SortableContent) Less(i, j int) bool

func (SortableContent) Swap

func (s SortableContent) Swap(i, j int)

type Theme

type Theme struct {
	Item

	Name        string `json:"name"`
	ModuleURL   string `json:"module_url"`
	Author      string `json:"author"`
	Screenshots string `json:"screenshots"`
	// contains filtered or unexported fields
}

func (*Theme) AfterAPICreate

func (s *Theme) AfterAPICreate(res http.ResponseWriter, req *http.Request) error

AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable

func (*Theme) Approve

func (s *Theme) Approve(res http.ResponseWriter, req *http.Request) error

Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.

func (*Theme) AutoApprove

func (s *Theme) AutoApprove(res http.ResponseWriter, req *http.Request) error

AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The

func (*Theme) BeforeAPICreate

func (s *Theme) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error

BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST

func (*Theme) Create

func (s *Theme) Create(res http.ResponseWriter, req *http.Request) error

Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded

func (*Theme) IndexContent

func (s *Theme) IndexContent() bool

func (*Theme) MarshalEditor

func (s *Theme) MarshalEditor() ([]byte, error)

MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable

func (*Theme) SelectContentTypes

func (s *Theme) SelectContentTypes() []string

func (*Theme) SetSelectData

func (s *Theme) SetSelectData(data map[string][][]byte)

func (*Theme) String

func (s *Theme) String() string

String defines the display name of a Song in the CMS list-view

Jump to

Keyboard shortcuts

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