sources

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sources provides implementations for the different types of source configurations available.

Index

Constants

View Source
const (
	SourceLocalPath = "local_path"
)
View Source
const (
	SourceS3 = "s3"
)

Variables

This section is empty.

Functions

func FromURL

func FromURL(n string) string

FromURL will take an expected source name from an external location and turn it into what can be assumed as the internal reference.

func New

func New(t string, c types.Configer) types.Sourcer

New will provision a new source instance based on the requested type.

func PrepareList

func PrepareList(s []types.Source) (o []types.Source)

PrepareList will decorate a list of sources with additional details that are mostly useful externally.

func PrepareSource added in v1.1.0

func PrepareSource(s types.Source) (o types.Source)

PrepareSource will decorate a single Source entry with external details.

Types

type LocalPath

type LocalPath struct {
	Location string `json:"location"`
	// contains filtered or unexported fields
}

LocalPath is the source implementation of working with the local filesystem.

func NewLocalPath

func NewLocalPath(c types.Configer) *LocalPath

NewLocalPath will provision an instance of LocalPath.

func (*LocalPath) CopyTo

func (l *LocalPath) CopyTo(r types.Reference, d types.Destination) (list []types.Reference, err error)

CopyTo will accept a Reference and Destination to copy the refered file to the provided destination.

func (*LocalPath) GetLocation added in v1.3.1

func (l *LocalPath) GetLocation() string

GetLocation will return the local path for this specific source.

func (*LocalPath) GetRefs

func (l *LocalPath) GetRefs() (r []types.Reference)

GetRefs will retrieve a list of all files within the source location.

func (*LocalPath) GetSubRefs added in v1.2.0

func (l *LocalPath) GetSubRefs(sub string) (r []types.Reference)

GetSubRefs...

func (*LocalPath) Type

func (l *LocalPath) Type() string

Type provides the name string for the LocalPath source type.

type S3

type S3 struct {
	Bucket  string `json:"bucket"`
	Depth   int    `json:"depth,omitempty"`
	Path    string `json:"path"`
	Profile string `json:"profile,omitempty"`
	// contains filtered or unexported fields
}

S3 is a data object that allows working with an S3 location.

func NewS3

func NewS3(c types.Configer) *S3

NewS3 will provision an S3 source.

func (*S3) CopyTo

func (s *S3) CopyTo(r types.Reference, d types.Destination) (list []types.Reference, err error)

CopyTo will carry out the copy operation from the current bucket configuration into the provided destination.

func (*S3) GetMatchingRefs

func (s *S3) GetMatchingRefs(r types.Reference) (refs []types.Reference)

GetMatchingRefs will pull a list of references from the bucket by using the prefix capability of the S3 API for a specific file path.

func (*S3) GetRefs

func (s *S3) GetRefs() (r []types.Reference)

GetRefs will pull a full list of references for the bucket, taking into account the nature of folder-structures with the depth.

func (*S3) GetSubRefs added in v1.2.0

func (s *S3) GetSubRefs(sub string) (r []types.Reference)

GetSubRefs will

func (*S3) Type

func (s *S3) Type() string

Type provides the string reference for this type of source.

Jump to

Keyboard shortcuts

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