bundles

package
v0.0.0-...-14ecd30 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BundleIndexFile   = "index.html"
	BundleHeaderFile  = "header.html"
	BundleFooterFile  = "footer.html"
	BundleOptionsFile = "options.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

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

func (*Bundle) AddFile

func (b *Bundle) AddFile(path string, file Opener)

func (*Bundle) GetBodyHtml

func (b *Bundle) GetBodyHtml() *string

func (*Bundle) GetFileAsStringByPath

func (b *Bundle) GetFileAsStringByPath(path string) (*string, error)

func (*Bundle) GetFileByPath

func (b *Bundle) GetFileByPath(path string) (io.ReadCloser, error)

func (*Bundle) GetFooterHtml

func (b *Bundle) GetFooterHtml() string

func (*Bundle) GetHeaderHtml

func (b *Bundle) GetHeaderHtml() string

func (*Bundle) GetOptions

func (b *Bundle) GetOptions() models.RenderOptions

func (*Bundle) ReadFromZip

func (b *Bundle) ReadFromZip(file io.ReaderAt, size int64) error

Read files from zip to intern map (path to file). This method can be called multiple times to assemble multiple zip bundles to one bundle.

func (*Bundle) TestIndexFile

func (b *Bundle) TestIndexFile() error

type BundleProviderService

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

func NewBundleProviderService

func NewBundleProviderService() *BundleProviderService

func (*BundleProviderService) GetById

func (bps *BundleProviderService) GetById(id uuid.UUID) (BundleReader, bool)

func (*BundleProviderService) Provide

func (bps *BundleProviderService) Provide(bundle *Bundle) (id uuid.UUID, cleanup CleanupFunc)

func (*BundleProviderService) Remove

func (bps *BundleProviderService) Remove(id uuid.UUID)

type BundleReader

type BundleReader interface {
	GetFileByPath(path string) (io.ReadCloser, error)
	GetFileAsStringByPath(path string) (*string, error)
	GetBodyHtml() *string
	GetHeaderHtml() string
	GetFooterHtml() string
	GetOptions() models.RenderOptions
}

type CleanupFunc

type CleanupFunc = func()

type MultipartFileOpener

type MultipartFileOpener interface {
	Open() (multipart.File, error)
}

type Opener

type Opener interface {
	Open() (io.ReadCloser, error)
}

type OpenerFileProxy

type OpenerFileProxy struct {
	MultipartFileOpener MultipartFileOpener
}

func (*OpenerFileProxy) Open

func (o *OpenerFileProxy) Open() (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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