Documentation ¶
Index ¶
- func NewKeepAChangelogParser(gm goldmark.Markdown) *kparser
- func NewOGParser(gm goldmark.Markdown) *ogparser
- type FileFormat
- type LoadResult
- type LoadedChangelog
- type Loader
- func (l *Loader) FromConfig(ctx context.Context, page Pagination) (LoadedChangelog, error)
- func (l *Loader) FromHost(ctx context.Context, host string, page Pagination) (LoadedChangelog, error)
- func (l *Loader) FromWorkspace(ctx context.Context, wID, cID string, page Pagination) (LoadedChangelog, error)
- type Meta
- type Pagination
- type ParseResult
- type ParsedArticle
- type ParsedChangelog
- type Parser
- type RawArticle
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKeepAChangelogParser ¶ added in v0.3.1
func NewOGParser ¶ added in v0.3.1
Types ¶
type LoadResult ¶
type LoadResult struct { Articles []RawArticle HasMore bool }
type LoadedChangelog ¶
type LoadedChangelog struct {
// contains filtered or unexported fields
}
LoadedChangelog represents a loaded changelog with its metadata.
func (LoadedChangelog) Parse ¶
func (c LoadedChangelog) Parse(ctx context.Context) ParsedChangelog
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader groups multiple ways of loading a changelog.
func (*Loader) FromConfig ¶
func (l *Loader) FromConfig(ctx context.Context, page Pagination) (LoadedChangelog, error)
func (*Loader) FromHost ¶ added in v0.1.2
func (l *Loader) FromHost(ctx context.Context, host string, page Pagination) (LoadedChangelog, error)
Tries to load the corresponding changelog for the host, either by it's subdomain or domain.
func (*Loader) FromWorkspace ¶
func (l *Loader) FromWorkspace(ctx context.Context, wID, cID string, page Pagination) (LoadedChangelog, error)
type Pagination ¶
type Pagination interface { PageSize() int Page() int StartIdx() int EndIdx() int // Returns true if the pagination is defined, else false and pagination should be ignored IsDefined() bool }
func NewPagination ¶
func NewPagination(pageSize int, page int) Pagination
func NoPagination ¶
func NoPagination() Pagination
type ParseResult ¶ added in v0.3.2
type ParseResult struct { Articles []ParsedArticle HasMore bool }
type ParsedArticle ¶
func (*ParsedArticle) AddTag ¶ added in v0.3.1
func (a *ParsedArticle) AddTag(t string)
type ParsedChangelog ¶
type ParsedChangelog struct { CL store.Changelog Articles []ParsedArticle HasMore bool }
ParsedChangelog represents a parsed changelog with its articles.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Parse ¶
func (p *Parser) Parse(ctx context.Context, raw []RawArticle, kPage Pagination) ParseResult
Parses all the raw articles, uses either the keep-a-changelog parser or our og parser. Uses the keep-a-changelog parser if only a single article in the keep-a-changelog format is provided. Pagination is only applied when using the keep-a-changelog parser. Else parses using the original parser.
type RawArticle ¶
type RawArticle struct {
Content io.ReadCloser
}
type Source ¶
type Source interface {
Load(ctx context.Context, page Pagination) (LoadResult, error)
}
A source is used to download the changelog articles from a target
Click to show internal directories.
Click to hide internal directories.