Documentation
¶
Overview ¶
Package seed stores the demo data set a development database starts from.
Index ¶
- Constants
- func Categories(ctx context.Context, store content.Store, types *content.Registry, ...) error
- func CategoriesField() content.Field
- func CategoryType() content.Type
- func Conditions(ctx context.Context, types *content.Registry) error
- func Containers(ctx context.Context, types *content.Registry) error
- func Media(ctx context.Context, library MediaLibrary, store media.Store, ...) error
- func OnSaleField() content.Field
- func PageType() content.Type
- func Pages(ctx context.Context, store content.Store, types *content.Registry, ...) error
- func Posts(ctx context.Context, store content.Store, types *content.Registry, ...) error
- func SaleNoteField() content.Field
- func TeamField() content.Field
- func TeamRowFields() []content.Field
- func Types(ctx context.Context, types *content.Registry) error
- type MediaLibrary
Constants ¶
const ( AdminEmail = "admin@example.com" AdminName = "Admin" AdminPassword = "password1234" EditorEmail = "editor@example.com" EditorName = "Editor" AuthorEmail = "author@example.com" AuthorName = "Author" )
Demo credentials stored by the seed subcommand, for development only.
const CategoriesFieldKey = "categories"
CategoriesFieldKey is the key posts point at their categories through.
const CategoryTypeKey = "category"
CategoryTypeKey is the key the demo categories are registered under.
const OnSaleFieldKey = "on-sale"
OnSaleFieldKey is the key the seeded switch a rule reads stores its value under.
const PageTypeKey = "page"
PageTypeKey names the content type the demo pages belong to.
const SaleNoteFieldKey = "sale-note"
SaleNoteFieldKey is the key the seeded field shown by a rule stores its value under.
const TeamFieldKey = "team"
TeamFieldKey is the key the seeded repeater stores its rows under.
Variables ¶
This section is empty.
Functions ¶
func Categories ¶ added in v0.5.0
func Categories( ctx context.Context, store content.Store, types *content.Registry, users gouncer.Store, ) error
Categories registers the category type, its relation field, and the demo categories.
func CategoriesField ¶ added in v0.5.0
CategoriesField returns the relation field the demo points posts at their categories through.
func CategoryType ¶ added in v0.5.0
CategoryType returns the content type the demo categories are registered under.
func Conditions ¶ added in v0.11.0
Conditions declares the seeded switch and the field its rule shows, the source first.
func Containers ¶ added in v0.11.0
Containers declares the seeded repeater and the fields one of its rows holds.
func OnSaleField ¶ added in v0.11.0
OnSaleField returns the switch the seeded rule reads.
func PageType ¶ added in v0.4.0
PageType returns the content type the demo pages are registered under.
func Pages ¶ added in v0.4.0
func Pages(ctx context.Context, store content.Store, types *content.Registry, users gouncer.Store) error
Pages stores the demo pages the site does not already hold.
func Posts ¶
func Posts(ctx context.Context, store content.Store, types *content.Registry, users gouncer.Store) error
Posts stores the demo posts the admin account does not already own.
func SaleNoteField ¶ added in v0.11.0
SaleNoteField returns the field the seeding shows only while the switch is on.
func TeamField ¶ added in v0.11.0
TeamField returns the repeater the seeding declares on the post type.
func TeamRowFields ¶ added in v0.11.0
TeamRowFields returns the fields the seeding declares inside one row of the repeater.