source

package
v0.0.0-...-0f597be Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package source is the interface for filesystems.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnimplemented is returned when a method is not implemented.
	ErrUnimplemented = errors.New("unimplemented")
	// ErrReadonly is returned when this filesystem is readonly.
	ErrReadonly = errors.New("readonly")
	// ErrNotDir is returned when something is not a directory.
	ErrNotDir = errors.New("not a directory")
)
View Source
var ErrOverSized = errors.New("oversized reader")

ErrOverSized is the error when the reader exceeds the limit.

Functions

func NewGitHubFs

func NewGitHubFs(repoOwner, repoName string, token *string, options ...GitHubFsOption) (afero.Fs, error)

NewGitHubFs creates a new github filesystem.

func NewS3Fs

func NewS3Fs(s3Url string, sessCfg *aws.Config) afero.Fs

NewS3Fs creates a new S3 filesystem with the given bucket name.

func ReadLimited

func ReadLimited(r io.Reader, limit int) (content []byte, n int64, err error)

ReadLimited reads from r until limit bytes or EOF, whichever comes first. If the limit is exceeded, it returns an error.

It returns the content read, the number of bytes read, and any error occurred.

Types

type GitHubFsOption

type GitHubFsOption func(*githubFsOptions)

GitHubFsOption is the option for NewGitHubFs.

func GitHubRef

func GitHubRef(ref string) GitHubFsOption

GitHubRef sets the ref of the GitHub repository.

Jump to

Keyboard shortcuts

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