fileprovider

package
v0.21.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSFileProvider

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

func NewFSFileProvider

func NewFSFileProvider(roots ...string) *FSFileProvider

func (*FSFileProvider) GetFile

func (*FSFileProvider) GetFile(file string) ([]byte, error)

func (*FSFileProvider) ListFiles

func (p *FSFileProvider) ListFiles() ([]string, error)

func (*FSFileProvider) PutFile

func (*FSFileProvider) PutFile(file string, content []byte) error

func (*FSFileProvider) ToInput

func (p *FSFileProvider) ToInput() (rules.Input, error)

type FileProvider

type FileProvider interface {
	ListFiles() ([]string, error)
	GetFile(string) ([]byte, error)
	PutFile(string, []byte) error
	ToInput() (rules.Input, error)
}

type InMemoryFileProvider

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

func NewInMemoryFileProvider

func NewInMemoryFileProvider(files map[string][]byte) *InMemoryFileProvider

func (*InMemoryFileProvider) GetFile

func (p *InMemoryFileProvider) GetFile(file string) ([]byte, error)

func (*InMemoryFileProvider) ListFiles

func (p *InMemoryFileProvider) ListFiles() ([]string, error)

func (*InMemoryFileProvider) PutFile

func (p *InMemoryFileProvider) PutFile(file string, content []byte) error

func (*InMemoryFileProvider) ToInput

func (p *InMemoryFileProvider) ToInput() (rules.Input, error)

Jump to

Keyboard shortcuts

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