Documentation
¶
Index ¶
- Constants
- func BlogNoImageUrl() string
- func GenerateShortID() string
- func IsShortID(id string) bool
- func NormalizeID(id string) string
- func ShortenID(id string) string
- func UnshortenID(shortID string) (string, error)
- type NewStoreOptions
- type Post
- func (o *Post) AddMetas(metas map[string]string) error
- func (o *Post) AuthorID() string
- func (o *Post) CanonicalURL() string
- func (o *Post) Content() string
- func (o *Post) ContentType() string
- func (o *Post) CreatedAt() string
- func (o *Post) CreatedAtCarbon() *carbon.Carbon
- func (o *Post) CreatedAtTime() time.Time
- func (o *Post) Editor() string
- func (o *Post) Featured() string
- func (o *Post) ID() string
- func (o *Post) ImageUrl() string
- func (o *Post) ImageUrlOrDefault() string
- func (o *Post) IsContentBlocks() bool
- func (o *Post) IsContentHtml() bool
- func (o *Post) IsContentMarkdown() bool
- func (o *Post) IsContentPlainText() bool
- func (o *Post) IsDraft() bool
- func (o *Post) IsPublished() bool
- func (o *Post) IsTrashed() bool
- func (o *Post) IsUnpublished() bool
- func (o *Post) MarshalToVersioning() (string, error)
- func (o *Post) Memo() string
- func (o *Post) Meta(key string) string
- func (o *Post) MetaDescription() string
- func (o *Post) MetaKeywords() string
- func (o *Post) MetaRobots() string
- func (o *Post) Metas() (map[string]string, error)
- func (o *Post) PublishedAt() string
- func (o *Post) PublishedAtCarbon() *carbon.Carbon
- func (o *Post) PublishedAtTime() time.Time
- func (o *Post) SetAuthorID(authorID string) *Post
- func (o *Post) SetCanonicalURL(canonicalURL string) *Post
- func (o *Post) SetContent(content string) *Post
- func (o *Post) SetContentType(contentType string) *Post
- func (o *Post) SetCreatedAt(createdAt string) *Post
- func (o *Post) SetEditor(editor string) *Post
- func (o *Post) SetFeatured(featured string) *Post
- func (o *Post) SetID(id string) *Post
- func (o *Post) SetImageUrl(imageURL string) *Post
- func (o *Post) SetMemo(memo string) *Post
- func (o *Post) SetMeta(key string, value string) error
- func (o *Post) SetMetaDescription(metaDescription string) *Post
- func (o *Post) SetMetaKeywords(metaKeywords string) *Post
- func (o *Post) SetMetaRobots(metaRobots string) *Post
- func (o *Post) SetMetas(metas map[string]string) error
- func (o *Post) SetPublishedAt(status string) *Post
- func (o *Post) SetSoftDeletedAt(deletedAt string) *Post
- func (o *Post) SetStatus(status string) *Post
- func (o *Post) SetSummary(summary string) *Post
- func (o *Post) SetTitle(title string) *Post
- func (o *Post) SetUpdatedAt(updatedAt string) *Post
- func (o *Post) Slug() string
- func (o *Post) SoftDeletedAt() string
- func (o *Post) SoftDeletedAtCarbon() *carbon.Carbon
- func (o *Post) Status() string
- func (o *Post) Summary() string
- func (o *Post) Title() string
- func (o *Post) UnmarshalFromVersioning(content string) error
- func (o *Post) UpdatedAt() string
- func (o *Post) UpdatedAtCarbon() *carbon.Carbon
- type PostQueryOptions
- type StoreInterface
- type VersioningInterface
- type VersioningQueryInterface
Constants ¶
View Source
const COLUMN_AUTHOR_ID = "author_id"
View Source
const COLUMN_CANONICAL_URL = "canonical_url"
View Source
const COLUMN_CONTENT = "content"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_FEATURED = "featured"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_IMAGE_URL = "image_url"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_METAS = "metas"
View Source
const COLUMN_META_DESCRIPTION = "meta_description"
View Source
const COLUMN_META_KEYWORDS = "meta_keywords"
View Source
const COLUMN_META_ROBOTS = "meta_robots"
View Source
const COLUMN_PUBLISHED_AT = "published_at"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_SUMMARY = "summary"
View Source
const COLUMN_TITLE = "title"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const NO = "no"
View Source
const POST_CONTENT_TYPE_BLOCKS = "blocks"
View Source
const POST_CONTENT_TYPE_HTML = "html"
View Source
const POST_CONTENT_TYPE_MARKDOWN = "markdown"
View Source
const POST_CONTENT_TYPE_PLAIN_TEXT = "plain_text"
View Source
const POST_EDITOR_BLOCKAREA = "BlockArea"
View Source
const POST_EDITOR_BLOCKEDITOR = "BlockEditor"
View Source
const POST_EDITOR_HTMLAREA = "HtmlArea"
View Source
const POST_EDITOR_MARKDOWN = "Markdown"
View Source
const POST_EDITOR_TEXTAREA = "TextArea"
View Source
const POST_STATUS_DRAFT = "draft"
View Source
const POST_STATUS_PUBLISHED = "published"
View Source
const POST_STATUS_TRASH = "trash"
View Source
const POST_STATUS_UNPUBLISHED = "unpublished"
View Source
const VERSIONING_TYPE_POST = "post"
View Source
const YES = "yes"
Variables ¶
This section is empty.
Functions ¶
func BlogNoImageUrl ¶
func BlogNoImageUrl() string
func GenerateShortID ¶ added in v1.5.0
func GenerateShortID() string
GenerateShortID generates a new 9-character shortened ID using TimestampMicro
func IsShortID ¶ added in v1.5.0
IsShortID checks if an ID appears to be shortened (9-21 chars, alphanumeric)
func NormalizeID ¶ added in v1.5.0
NormalizeID normalizes an ID for lookup (lowercase)
func UnshortenID ¶ added in v1.5.0
UnshortenID attempts to unshorten a Crockford Base32 ID
Types ¶
type NewStoreOptions ¶
type NewStoreOptions struct {
PostTableName string
DB *sql.DB
DbDriverName string
TimeoutSeconds int64
AutomigrateEnabled bool
DebugEnabled bool
VersioningEnabled bool
VersioningTableName string
}
NewStoreOptions define the options for creating a new block store
type Post ¶
type Post struct {
dataobject.DataObject
}
func NewPostFromExistingData ¶
func (*Post) CanonicalURL ¶
func (*Post) ContentType ¶ added in v1.3.1
func (*Post) CreatedAtCarbon ¶
func (*Post) CreatedAtTime ¶
func (*Post) ImageUrlOrDefault ¶
func (*Post) IsContentBlocks ¶ added in v1.3.1
func (*Post) IsContentHtml ¶ added in v1.3.1
func (*Post) IsContentMarkdown ¶ added in v1.3.1
func (*Post) IsContentPlainText ¶ added in v1.3.1
func (*Post) IsPublished ¶
func (*Post) IsUnpublished ¶
func (*Post) MarshalToVersioning ¶ added in v1.4.0
func (*Post) MetaDescription ¶
func (*Post) MetaKeywords ¶
func (*Post) MetaRobots ¶
func (*Post) PublishedAt ¶
func (*Post) PublishedAtCarbon ¶
func (*Post) PublishedAtTime ¶
func (*Post) SetAuthorID ¶
func (*Post) SetCanonicalURL ¶
func (*Post) SetContent ¶
func (*Post) SetContentType ¶ added in v1.3.1
func (*Post) SetCreatedAt ¶
func (*Post) SetFeatured ¶
func (*Post) SetImageUrl ¶
func (*Post) SetMetaDescription ¶
func (*Post) SetMetaKeywords ¶
func (*Post) SetMetaRobots ¶
func (*Post) SetPublishedAt ¶
func (*Post) SetSoftDeletedAt ¶ added in v1.2.1
func (*Post) SetSummary ¶
func (*Post) SetUpdatedAt ¶
func (*Post) SoftDeletedAt ¶ added in v1.2.1
func (*Post) SoftDeletedAtCarbon ¶ added in v1.2.1
func (*Post) UnmarshalFromVersioning ¶ added in v1.4.3
func (*Post) UpdatedAtCarbon ¶
type PostQueryOptions ¶
type StoreInterface ¶
type StoreInterface interface {
AutoMigrate() error
EnableDebug(debug bool) StoreInterface
VersioningEnabled() bool
PostCount(ctx context.Context, options PostQueryOptions) (int64, error)
PostCreate(ctx context.Context, post *Post) error
PostDelete(ctx context.Context, post *Post) error
PostDeleteByID(ctx context.Context, postID string) error
PostFindByID(ctx context.Context, id string) (*Post, error)
PostList(ctx context.Context, options PostQueryOptions) ([]Post, error)
PostSoftDelete(ctx context.Context, post *Post) error
PostSoftDeleteByID(ctx context.Context, postID string) error
PostTrash(ctx context.Context, post *Post) error
PostUpdate(ctx context.Context, post *Post) error
// Versioning
VersioningCreate(ctx context.Context, versioning VersioningInterface) error
VersioningDelete(ctx context.Context, versioning VersioningInterface) error
VersioningDeleteByID(ctx context.Context, id string) error
VersioningFindByID(ctx context.Context, versioningID string) (VersioningInterface, error)
VersioningList(ctx context.Context, query VersioningQueryInterface) ([]VersioningInterface, error)
VersioningSoftDelete(ctx context.Context, versioning VersioningInterface) error
VersioningSoftDeleteByID(ctx context.Context, id string) error
VersioningUpdate(ctx context.Context, versioning VersioningInterface) error
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (StoreInterface, error)
NewStore creates a new block store
type VersioningInterface ¶ added in v1.4.0
type VersioningInterface = versionstore.VersionInterface
func NewVersioning ¶ added in v1.4.0
func NewVersioning() VersioningInterface
type VersioningQueryInterface ¶ added in v1.4.0
type VersioningQueryInterface = versionstore.VersionQueryInterface
func NewVersioningQuery ¶ added in v1.4.0
func NewVersioningQuery() VersioningQueryInterface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.