loader

package
v0.0.0-...-a57b13e Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GHLoader

type GHLoader struct {
	Owner          string
	Repo           string
	Path           string
	InstallationID int64
	// contains filtered or unexported fields
}

func (GHLoader) Load

func (s GHLoader) Load(ctx context.Context, params Pagination) (LoadResult, error)

type GithubLoaderOptions

type GithubLoaderOptions struct {
	// The account name of the owner of the repository
	Owner string
	// The repository which holds the markdown files
	Repository string
	// The path to the root of the directory which holds all markdown files
	Path              string
	AppPrivateKey     string
	AppInstallationId int64
	AccessToken       string
}

type ID

type ID int64

func NewID

func NewID(id int64) ID

func (ID) ToInt

func (i ID) ToInt() int64

type LoadResult

type LoadResult struct {
	Articles []RawArticle
	HasMore  bool
}

type Loader

type Loader interface {
	Load(ctx context.Context, page Pagination) (LoadResult, error)
}

A loader downloads the changelog markdown files.

func NewGithub

func NewGithub(opts GithubLoaderOptions) (Loader, error)

func NewLocalFile

func NewLocalFile(path string) Loader

func String

func String(articles []string) Loader

type LocalFileLoader

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

func (LocalFileLoader) Load

type Pagination

type Pagination interface {
	PageSize() int
	Page() int
	StartIdx() int
	EndIdx() int
}

func NewPagination

func NewPagination(pageSize int, page int) Pagination

type RawArticle

type RawArticle struct {
	Content io.ReadCloser
}

Jump to

Keyboard shortcuts

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