generic

package
v0.0.0-...-e9e1808 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAS

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

func NewCAS

func NewCAS(inner fs.FS, casStore *CASStore) *CAS

func (*CAS) Open

func (c *CAS) Open(sri string) (io.ReadCloser, error)

type CASStore

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

func NewCASStore

func NewCASStore() *CASStore

func (*CASStore) Get

func (c *CASStore) Get(sri string) (string, bool)

Get returns the file path for the given sri.

func (*CASStore) Set

func (c *CASStore) Set(sri, path string)

Set sets the file path for the given sri. If the sri already exists, the old file path will be kept.

type Provider

type Provider struct{}

func (Provider) CAS

func (p Provider) CAS() (api.CAS, api.CloseWaitFunc, error)

func (Provider) CASReader

func (p Provider) CASReader() (api.CASReader, api.CloseWaitFunc, error)

func (Provider) CASWriter

func (p Provider) CASWriter() (api.CASWriter, api.CloseWaitFunc, error)

func (Provider) Name

func (p Provider) Name() string

func (Provider) SinkBuilder

func (p Provider) SinkBuilder() provider.SinkBuilder

func (Provider) SourceBuilder

func (p Provider) SourceBuilder() provider.SourceBuilder

type Source

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

func (*Source) Next

func (s *Source) Next() (api.SourceNode, error)

func (*Source) Open

func (s *Source) Open(sri string) (io.ReadCloser, error)

type SourceBuilder

type SourceBuilder struct {
	SRIAlgorithm   sri.Algorithm `abstractfs:"cas-algorithm"`
	NodeAttributes func(iofs.FileInfo) api.NodeAttributes
	StripPrefix    string `abstractfs:"strip-prefix"`
	FS             iofs.FS
	// contains filtered or unexported fields
}

func (*SourceBuilder) Build

func (b *SourceBuilder) Build() (api.Source, api.CloseWaitFunc, error)

Build builds the options.

func (*SourceBuilder) WithFS

func (b *SourceBuilder) WithFS(fs iofs.FS) provider.SourceBuilder

func (*SourceBuilder) WithNodeAttributes

func (b *SourceBuilder) WithNodeAttributes(nodeAttributes func(iofs.FileInfo) api.NodeAttributes) provider.SourceBuilder

func (*SourceBuilder) WithSourceRef

func (b *SourceBuilder) WithSourceRef(_ string) provider.SourceBuilder

WithSourceRef sets the source reference. The generic provider does not support source references. It always needs a io.FS.

Jump to

Keyboard shortcuts

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