resource

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const NotfoundResource = Resource("")

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterScanner

type AfterScanner interface {
	After()
}

AfterScanner is an interface for resource scanner.

type BeforeScanner

type BeforeScanner interface {
	Before()
}

BeforeScanner is an interface for resource scanner.

type Resource

type Resource string

Resource is a type name for configuration file.

f := config.Resource("./config/app.yaml")
f := config.Resource("/data/sketch/config/app.yaml")

func (Resource) Found added in v1.0.2

func (o Resource) Found() bool

Found return true if resource is existed.

func (Resource) Notfound

func (o Resource) Notfound() bool

Notfound return true if resource is empty.

func (Resource) Read

func (o Resource) Read() (data []byte, err error)

Read reads resource content.

func (Resource) ScanJson

func (o Resource) ScanJson(v any) (err error)

ScanJson scans resource content of json to v.

func (Resource) ScanYaml

func (o Resource) ScanYaml(v any) (err error)

ScanYaml scans resource content of yaml to v.

func (Resource) String

func (o Resource) String() string

String return resource name.

return "/data/sketch/config/app.yaml"

Jump to

Keyboard shortcuts

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