sources

package
v2.0.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupportedFile

func IsSupportedFile(name string) bool

func ToDir

func ToDir(path string) string

Types

type Aggregate

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

func NewAggregate

func NewAggregate(sources ...Source) *Aggregate

func (*Aggregate) Add

func (a *Aggregate) Add(src Source)

func (*Aggregate) Read

func (a *Aggregate) Read(ctx context.Context) (<-chan File, <-chan Error)

func (*Aggregate) Resolve

func (a *Aggregate) Resolve(_ context.Context, _ *url.URL) (<-chan File, <-chan Error)

type Error

type Error struct {
	Filename string
	Message  string
}

func NewError

func NewError(filename string, message string) Error

func NewErrorFrom

func NewErrorFrom(filename string, err error) Error

func (Error) Error

func (e Error) Error() string

type File

type File struct {
	Source  Source
	Name    string
	Content []byte
}

func (File) Resolve

func (f File) Resolve(ctx context.Context, u *url.URL) (onNext <-chan File, onError <-chan Error)

type FileSystem

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

func (*FileSystem) Read

func (fs *FileSystem) Read(ctx context.Context) (<-chan File, <-chan Error)

func (*FileSystem) Resolve

func (fs *FileSystem) Resolve(ctx context.Context, u *url.URL) (<-chan File, <-chan Error)

type Git

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

func (*Git) Read

func (g *Git) Read(ctx context.Context) (<-chan File, <-chan Error)

func (*Git) Resolve

func (g *Git) Resolve(ctx context.Context, u *url.URL) (<-chan File, <-chan Error)

type HTTP

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

func (*HTTP) Read

func (src *HTTP) Read(ctx context.Context) (<-chan File, <-chan Error)

func (*HTTP) Resolve

func (src *HTTP) Resolve(ctx context.Context, u *url.URL) (<-chan File, <-chan Error)

type Noop

type Noop struct{}

func NewNoop

func NewNoop() *Noop

func (Noop) Read

func (n Noop) Read(_ context.Context) (<-chan File, <-chan Error)

func (Noop) Resolve

func (n Noop) Resolve(ctx context.Context, _ *url.URL) (<-chan File, <-chan Error)

type Source

type Source interface {
	Read(ctx context.Context) (onNext <-chan File, onError <-chan Error)
	Resolve(ctx context.Context, url *url.URL) (onNext <-chan File, onError <-chan Error)
}

func Create

func Create(str string) (Source, error)

func CreateFrom

func CreateFrom(u *url.URL) (Source, error)

func New

func New(locations ...string) (Source, error)

func NewFileSystem

func NewFileSystem(u *url.URL) (Source, error)

func NewGit

func NewGit(u *url.URL) (Source, error)

func NewGitFrom

func NewGitFrom(repo *git.Repository, filter glob.Glob) (Source, error)

func NewHTTP

func NewHTTP(u *url.URL) (Source, error)

type SourceFactory

type SourceFactory func(u *url.URL) (Source, error)

type SourceType

type SourceType int
const (
	SourceTypeUnknown SourceType = 0
	SourceTypeFS      SourceType = 1
	SourceTypeHTTP    SourceType = 2
	SourceTypeGIT     SourceType = 3
)

func GetType

func GetType(u *url.URL) SourceType

Jump to

Keyboard shortcuts

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