source

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 13 Imported by: 0

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, logger *zap.SugaredLogger) *Service

func (*Service) Clear

func (s *Service) Clear()

func (*Service) Delete

func (s *Service) Delete(key string) error

func (*Service) GetOverrides

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

func (*Service) List

func (s *Service) List() (Sources, error)

func (*Service) Load

func (s *Service) Load(key string, force bool) (*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) 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) (*schema.Schema, float64, error)

func (*Service) Search

func (s *Service) Search(q string) (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