resources

package
v0.0.0-...-790a62a Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenReader

func OpenReader(name string) (*iorw.EOFCloseSeekReader, error)

Types

type EmbeddedResource

type EmbeddedResource struct {
	*iorw.Buffer
	// contains filtered or unexported fields
}

func NewEmbeddedResource

func NewEmbeddedResource(rscngendpnt *ResourcingEndpoint) (embdrs *EmbeddedResource)

func (*EmbeddedResource) Clear

func (embdrs *EmbeddedResource) Clear()

func (*EmbeddedResource) Close

func (embdrs *EmbeddedResource) Close() (err error)

func (*EmbeddedResource) Name

func (embdrs *EmbeddedResource) Name() string

type FS

type FS interface {
	fs.FS
	fs.ReadDirFS
	fs.ReadFileFS
}

type Resource

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

Resource - struct

func (*Resource) Close

func (rs *Resource) Close() (err error)

Close - refer to io.Closer

func (*Resource) Read

func (rs *Resource) Read(p []byte) (n int, err error)

func (*Resource) Seek

func (rs *Resource) Seek(offset int64, whence int) (n int64, err error)

Seek - refer to io.Seeker

type ResourcingEndpoint

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

ResourcingEndpoint - struct

func (*ResourcingEndpoint) FS

func (rscngepnt *ResourcingEndpoint) FS() *fsutils.FSUtils

FS return fsutils.FSUtils implementation for *ResourcingEndPoint

func (*ResourcingEndpoint) LastModified

func (rscngepnt *ResourcingEndpoint) LastModified() (modified time.Time)

func (*ResourcingEndpoint) RemoveResource

func (rscngepnt *ResourcingEndpoint) RemoveResource(path string) (rmvd bool)

RemoveResource - remove inline resource - true if found and removed and false if not exists

func (*ResourcingEndpoint) Resource

func (rscngepnt *ResourcingEndpoint) Resource(path string) (rs interface{})

Resource - return mapped resource interface{} by path

type ResourcingManager

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

ResourcingManager - struct

func GLOBALRSNG

func GLOBALRSNG() *ResourcingManager

GLOBALRSNG - GLOBAL Resourcing for app

func NewResourcingManager

func NewResourcingManager() (rscngmngr *ResourcingManager)

NewResourcingManager - instance

func (*ResourcingManager) Close

func (rscngmngr *ResourcingManager) Close() (err error)

Close *ResouringManager

func (*ResourcingManager) EndpointResource

func (rscngmngr *ResourcingManager) EndpointResource(path string) (epntrs interface{})

EndpointResource - Endpoint embedded resource via path

func (*ResourcingManager) EndpointViaPath

func (rscngmngr *ResourcingManager) EndpointViaPath(path string) (rsngendpt *ResourcingEndpoint)

EndpointViaPath return ResourcingEndpoint via path

func (*ResourcingManager) FS

func (rscngmngr *ResourcingManager) FS() *fsutils.FSUtils

FS return fsutils.FSUtils implementation for *ResourcingManager

func (*ResourcingManager) FindRS

func (rscngmngr *ResourcingManager) FindRS(path string) (rs io.ReadCloser, modified time.Time, err error)

FindRS - find Resource

func (*ResourcingManager) FindRSString

func (rscngmngr *ResourcingManager) FindRSString(path string) (s string, modified time.Time, err error)

FindRSString - find Resource

func (*ResourcingManager) IsRegisteredPath

func (rscngmngr *ResourcingManager) IsRegisteredPath(path string) (exists bool)

IsRegisteredPath return true indicating if a path is registered

func (*ResourcingManager) RegisterEndpoint

func (rscngmngr *ResourcingManager) RegisterEndpoint(path string, rootpath string, prms ...interface{})

RegisterEndpoint - register ResourcingEndPoint

func (*ResourcingManager) RegisterEndpoints

func (rscngmngr *ResourcingManager) RegisterEndpoints(args ...interface{})

RegisterEndpoints register multiple Endpoints

func (*ResourcingManager) RegisteredPaths

func (rscngmngr *ResourcingManager) RegisteredPaths() (paths []string)

RegisteredPaths return registered paths

func (*ResourcingManager) RemovePathResource

func (rscngmngr *ResourcingManager) RemovePathResource(path string) (rmvd bool)

RemovePathResource - Remove Endpoint Resource via path

func (*ResourcingManager) UnregisterPath

func (rscngmngr *ResourcingManager) UnregisterPath(path string) (rmvd bool)

UnregisterPath - register path string

func (*ResourcingManager) UnregisterPaths

func (rscngmngr *ResourcingManager) UnregisterPaths(path ...string)

UnregisterPaths unregister multiple paths

Jump to

Keyboard shortcuts

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