resource

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGifImage

func IsGifImage(header []byte) bool

func IsJpeg2000Image

func IsJpeg2000Image(header []byte) bool

func IsJpegImage

func IsJpegImage(header []byte) bool

func IsPngImage

func IsPngImage(header []byte) bool

func IsTiffImage

func IsTiffImage(header []byte) bool

func IsValidBitmapImage

func IsValidBitmapImage(header []byte) bool

Types

type DlexResource

type DlexResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents a Dlex resource object that is created using the DLEX file and a name.

func NewDlexResourceWithByteValue

func NewDlexResourceWithByteValue(value []byte, resourceName string) *DlexResource

Initializes a new instance of the `DlexResource` class with DLEX file path and resource name or byte data of the DLEX file and resource name as parameters.

  • @param {byte[]} The byte array of the dlex file.
  • @param {string} resource The name of the resource.

func NewDlexResourceWithPath

func NewDlexResourceWithPath(dlexPath string, resourceName string) *DlexResource

Initializes a new instance of the `DlexResource` class with DLEX file path and resource name or byte data of the DLEX file and resource name as parameters.

  • @param {string} dlex The dlex file path.
  • @param {string} resource The name of the resource.

func (DlexResource) LayoutDataResourceName

func (p DlexResource) LayoutDataResourceName() string

Gets name for layout data resource.

func (DlexResource) ResourceType

func (p DlexResource) ResourceType() ResourceType

func (DlexResource) SetLayoutDataResourceName

func (p DlexResource) SetLayoutDataResourceName(layoutData string)

Sets name for layout data resource.

type FontResource

type FontResource struct {
	Resource
}

func NewFontResource

func NewFontResource() *FontResource

func (FontResource) FileExtension

func (p FontResource) FileExtension() string

func (FontResource) ResourceType

func (p FontResource) ResourceType() ResourceType

type HtmlResource

type HtmlResource struct {
	Resource
}

Represents the pdf resource.

func NewHtmlResource

func NewHtmlResource(resource string, resourceName string) HtmlResource

Initializes a new instance of the `HtmlResource` class with html string and resource name. * @param {string} html The Html string. * @param {string} resource The name of the resource.

func (HtmlResource) ResourceType

func (p HtmlResource) ResourceType() ResourceType

type ImageResource

type ImageResource struct {
	Resource
}

Represents an image resource used to create an `ImageResource` object to create PDF from images.

func NewImageResourceWithByteValue

func NewImageResourceWithByteValue(resource []byte, resourceName string) ImageResource

Initializes a new instance of the `ImageResource` class.

  • @param {Byte[]} The byte array of the image file.
  • @param {string} resourceName The name of the resource.

func NewImageResourceWithResourcePath

func NewImageResourceWithResourcePath(resource string, resourceName string) ImageResource

Initializes a new instance of the `ImageResource` class.

  • @param {string} filePath The image file path.
  • @param {string} resourceName The name of the resource.

func (ImageResource) ResourceType

func (p ImageResource) ResourceType() ResourceType

type LayoutDataResource

type LayoutDataResource struct {
	Resource
}

Represents the Layout data resource used to create PDF reports.

func NewLayoutDataResource

func NewLayoutDataResource(filepath string, layoutdataresourcename string) LayoutDataResource

Initializes a new instance of the `LayoutDataResource` class using the layout data object and a resource name.

  • @param {string }The layout data JSON file path.
  • @param {string} layoutDataResourceName The name for layout data resource.

func (LayoutDataResource) ResourceType

func (p LayoutDataResource) ResourceType() ResourceType

type PdfResource

type PdfResource struct {
	Resource
	// contains filtered or unexported fields
}

Represents the pdf resource.

func NewPdfResourceWithByteValue

func NewPdfResourceWithByteValue(resource string, resourceName string) PdfResource

Initializes a new instance of the `PdfResource` class.

  • @param {Byte[]}The byte array of the pdf file.
  • @param {string} resourceName The name of the resource.

func NewPdfResourceWithResourcePath

func NewPdfResourceWithResourcePath(resource string, resourceName string) PdfResource

Initializes a new instance of the `PdfResource` class.

  • @param {string} input The pdf file path.
  • @param {string} resourceName The name of the resource.

func (PdfResource) ResourceType

func (p PdfResource) ResourceType() ResourceType

type Resource

type Resource struct {
	// Gets or sets the resource name.
	ResourceName           string `json:"resourceName,omitempty"`
	LayoutDataResourceName string `json:"layoutDataResourceName,omitempty"`
	// contains filtered or unexported fields
}

Represents the base class resource.

func NewResourceWithByteValue

func NewResourceWithByteValue(input []byte, resourceName string) *Resource

func NewResourceWithPath

func NewResourceWithPath(input string, resourceName string) Resource

func (*Resource) Data

func (p *Resource) Data() []byte

func (*Resource) MarshalJSON

func (p *Resource) MarshalJSON() ([]byte, error)

func (*Resource) ResourceType

func (p *Resource) ResourceType() ResourceType

type ResourceType

type ResourceType int
const (
	// Image resource.
	ImageResourceType ResourceType = 0
	// Pdf resource.
	PdfResourceType ResourceType = 1
	// LayoutData resource.
	LayoutDataResourceType ResourceType = 2
	// Dlex resource.
	DlexResourceType ResourceType = 3
	// Font resource.
	FontResourceType ResourceType = 4
	// Html resource
	HtmlResourceType ResourceType = 5
)

Jump to

Keyboard shortcuts

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