reader

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilePrefix = "file"
	NoPrefix   = ""
)
View Source
const (
	HttpsPrefix = "https"
	HttpPrefix  = "http"
)
View Source
const (
	InputKindFile = "file"
	InputKindDir  = "dir"
)
View Source
const (
	SshPrefix      = "ssh"
	DefaultPort    = "22"
	DefaultPubFile = "id_ed25519"
)
View Source
const (
	GitHttpsPrefix = "git_https"
)

Variables

View Source
var InputSchemesMap = map[string]bool{

	FilePrefix:     true,
	HttpsPrefix:    true,
	HttpPrefix:     true,
	SshPrefix:      true,
	GitHttpsPrefix: true,
	NoPrefix:       true,
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Factory

type Factory func(filePath string) (InputValue, error)

func DetermineReader

func DetermineReader(filePath string) (Factory, error)

type InputKind

type InputKind string

type InputValue

type InputValue struct {
	Kind  InputKind
	Value map[string][]byte
}

func ReadDir

func ReadDir(dir string) (InputValue, error)

ReadDir Reader protocol that reads content of provided directory.

func ReadFile

func ReadFile(filePath string) (InputValue, error)

ReadFile Reader protocol that reads content from a file no matter the extension.

func ReadGitHttps added in v0.2.1

func ReadGitHttps(gitPath string) (InputValue, error)

func ReadHttps

func ReadHttps(httpPath string) (InputValue, error)

ReadHttps Reader protocol that reads content of provided https url. It acts similarly to ReadFile since input is response body from url that is provided.

func ReadSsh added in v0.2.1

func ReadSsh(sshPath string) (InputValue, error)

ReadSsh Reader protocol that allows user to read content via ssh.

Jump to

Keyboard shortcuts

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