Documentation ¶
Overview ¶
Package static is an implementation of Source which loads assets from a static JSON file.
Index ¶
- type StaticSource
- func (s *StaticSource) Channels() ([]assets.Channel, error)
- func (s *StaticSource) Fields() ([]assets.Field, error)
- func (s *StaticSource) Flow(uuid assets.FlowUUID) (assets.Flow, error)
- func (s *StaticSource) Groups() ([]assets.Group, error)
- func (s *StaticSource) Labels() ([]assets.Label, error)
- func (s *StaticSource) Locations() ([]assets.LocationHierarchy, error)
- func (s *StaticSource) Resthooks() ([]assets.Resthook, error)
- func (s *StaticSource) Templates() ([]assets.Template, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StaticSource ¶
type StaticSource struct {
// contains filtered or unexported fields
}
StaticSource is an asset source which loads assets from a static JSON file
func LoadSource ¶ added in v0.26.0
func LoadSource(path string) (*StaticSource, error)
LoadSource loads a new static source from the given JSON file
func NewEmptySource ¶ added in v0.26.0
func NewEmptySource() *StaticSource
NewEmptySource creates a new empty source with no assets
func NewSource ¶ added in v0.26.0
func NewSource(data json.RawMessage) (*StaticSource, error)
NewSource creates a new static source from the given JSON
func (*StaticSource) Channels ¶
func (s *StaticSource) Channels() ([]assets.Channel, error)
Channels returns all channel assets
func (*StaticSource) Fields ¶
func (s *StaticSource) Fields() ([]assets.Field, error)
Fields returns all field assets
func (*StaticSource) Groups ¶
func (s *StaticSource) Groups() ([]assets.Group, error)
Groups returns all group assets
func (*StaticSource) Labels ¶
func (s *StaticSource) Labels() ([]assets.Label, error)
Labels returns all label assets
func (*StaticSource) Locations ¶
func (s *StaticSource) Locations() ([]assets.LocationHierarchy, error)
Locations returns all location assets
Click to show internal directories.
Click to hide internal directories.