content

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTML fType = iota
	Telegram
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content interface {
	ConvWithTmpl(format fType, tmplPath string) (*bytes.Buffer, error)
	Conv(format fType) (*bytes.Buffer, error)
	Sync(path string) error
	WriteRouter(path string) error
	GetMetadata() *Metadata
}

func New

func New(path string, contentFiles []string, opts ...Option) (Content, error)

type Metadata

type Metadata struct {
	Telegram telegramData      `json:"telegram"`
	Static   staticData        `json:"static"`
	Tags     map[string]string `json:"tags"`
}

Metadata ...

func (*Metadata) Sync

func (m *Metadata) Sync(path string) (err error)

Sync updates the metadata file at the specified path with the information from the provided Metadata object.

func (*Metadata) WriteRouter

func (m *Metadata) WriteRouter(path string) error

WriteRouter appends the current Metadata object to a list of metadata stored in a file at the given path.

type Option

type Option func(Content)

Option ...

Jump to

Keyboard shortcuts

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