Documentation ¶
Overview ¶
Package sources provides implementations for the different types of source configurations available.
Index ¶
- Constants
- func CreateNew(s types.ConfigAddSource) types.Source
- func FromURL(n string) string
- func New(t string, c types.Configer) types.Sourcer
- func PrepareList(s []types.Source) (o []types.Source)
- func PrepareSource(s types.Source) (o types.Source)
- func UpdateExisting(e types.ConfigAddSource, s types.Source) types.Source
- type LocalPath
- type S3
Constants ¶
const ( // SourceLocalPath is the identifier to be used with associating // a source that uses the local filesystem. SourceLocalPath = "local_path" )
const ( // SourceS3 is the identifier to be used for association with // a source that is coming from S3. SourceS3 = "s3" )
Variables ¶
This section is empty.
Functions ¶
func CreateNew ¶ added in v1.5.0
func CreateNew(s types.ConfigAddSource) types.Source
CreateNew will take a submission and prepare for utilisation.
func FromURL ¶
FromURL will take an expected source name from an external location and turn it into what can be assumed as the internal reference.
func PrepareList ¶
PrepareList will decorate a list of sources with additional details that are mostly useful externally.
func PrepareSource ¶ added in v1.1.0
PrepareSource will decorate a single Source entry with external details.
func UpdateExisting ¶ added in v1.5.0
UpdateExisting will take a new and existing source, generating a new one that combines the editable details with the existing others.
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 ¶
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
GetLocation will return the local path for this specific source.
func (*LocalPath) GetSubRefs ¶ added in v1.2.0
GetSubRefs...
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 (*S3) CopyTo ¶
CopyTo will carry out the copy operation from the current bucket configuration into the provided destination.
func (*S3) GetMatchingRefs ¶
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 ¶
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
GetSubRefs will