HomeUniDoc
...

Package content

Overview ▾

type Content

Content is an interface used for putting the content into Client Query.

type Content interface {
    ContentType() string
    Method() string
    Data() []byte
}

func NewHTMLFile

func NewHTMLFile(path string) (Content, error)

NewHTMLFile creates new Content htmFile for provided input path.

func NewWebURL

func NewWebURL(path string) (Content, error)

NewWebURL creates new Content webURL for provided input URL path.

func NewZipDirectory

func NewZipDirectory(dirPath string) (Content, error)

NewZipDirectory creates new zip compressed file that recursively reads the directory at the 'dirPath' and stores in it's in-memory buffer.

type StringContent

StringContent implements Content interface for an HTML string.

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

func NewStringContent

func NewStringContent(html string) (*StringContent, error)

NewStringContent creates a new StringContent.

func (*StringContent) ContentType

func (sc *StringContent) ContentType() string

ContentType implements Content interface.

func (*StringContent) Data

func (sc *StringContent) Data() []byte

Data implements Content interface.

func (*StringContent) Method

func (sc *StringContent) Method() string

Method implements Content interface.