source

package
v0.2.35 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(files filesystem.FileLoader, ld *loader.Service) *Service

func (*Service) Clear

func (s *Service) Clear()

func (*Service) Delete

func (s *Service) Delete(key string, logger util.Logger) error

func (*Service) GetOverrides

func (s *Service) GetOverrides(key string) (schema.Overrides, error)

func (*Service) List

func (s *Service) List(logger util.Logger) (Sources, error)

func (*Service) Load

func (s *Service) Load(key string, force bool, logger util.Logger) (*Source, error)

func (*Service) LoadSchema

func (s *Service) LoadSchema(key string) (*schema.Schema, error)

func (*Service) NewSource

func (s *Service) NewSource(key string, title string, icon string, description string, t schema.Origin) *Source

func (*Service) Save

func (s *Service) Save(src *Source, overwrite bool, logger util.Logger) error

func (*Service) SaveOverrides

func (s *Service) SaveOverrides(key string, os schema.Overrides) error

func (*Service) SaveSchema

func (s *Service) SaveSchema(key string, sch *schema.Schema) error

func (*Service) SchemaRefresh

func (s *Service) SchemaRefresh(ctx context.Context, key string, logger util.Logger) (*schema.Schema, float64, error)

func (*Service) Search

func (s *Service) Search(q string, logger util.Logger) (result.Results, error)

type Source

type Source struct {
	Key         string          `json:"-"`
	Title       string          `json:"title,omitempty"`
	Icon        string          `json:"icon,omitempty"`
	Description string          `json:"description,omitempty"`
	Paths       []string        `json:"paths,omitempty"`
	Type        schema.Origin   `json:"type,omitempty"`
	Config      json.RawMessage `json:"config,omitempty"`
}

func (*Source) IconWithFallback

func (s *Source) IconWithFallback() string

func (*Source) Name

func (s *Source) Name() string

func (*Source) WebPath

func (s *Source) WebPath() string

type Sources

type Sources []*Source

func (Sources) Get

func (s Sources) Get(key string) *Source

func (Sources) GetWithError

func (s Sources) GetWithError(key string) (*Source, error)

func (Sources) Keys

func (s Sources) Keys() []string

func (Sources) Names

func (s Sources) Names() []string

func (Sources) Sort

func (s Sources) Sort()

Jump to

Keyboard shortcuts

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