Documentation ¶
Index ¶
Constants ¶
const ( // SecuritySourceBackground is used when security is set from the compute instance level SecuritySourceBackground = "background" // SecuritySourceFile is used when security is set by JWT config from a JSON file SecuritySourceFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func InitFetchers ¶
InitFetchers initializes fetchers from config
Types ¶
type Fetcher ¶
type Fetcher interface { GetName() string GetFetcherType() string Fetch(ctx echo.Context, url string) (responseBody io.Reader, contentType string, err error) }
Fetcher interface handles fetching content from different sources
func GetFetcherByName ¶
GetFetcherByName returns a fetcher by its configured name
func GetFetcherByPath ¶
GetFetcherByPath returns the fetcher specified by its path
func GetFetcherByType ¶
GetFetcherByType returns the fetcher specified by its type
type GoogleStroageFetcher ¶
type GoogleStroageFetcher struct { Name string FetcherType string Bucket string Path string ProjectID string SecuritySource string ServiceAccountJSONFile string }
GoogleStroageFetcher fetches content from http/https sources
URL Format used: gs://bucketName/path/file
func NewGoogleStroageFetcher ¶
func NewGoogleStroageFetcher(cfg map[string]interface{}) *GoogleStroageFetcher
NewGoogleStroageFetcher creates a new fetcher that support Google Storage buckets
func (*GoogleStroageFetcher) GetFetcherType ¶
func (fetcher *GoogleStroageFetcher) GetFetcherType() string
GetFetcherType returns the type of this fetcher to be used in the 'type' properties when defining fetchers
func (*GoogleStroageFetcher) GetName ¶
func (fetcher *GoogleStroageFetcher) GetName() string
GetName returns the name assigned to this fetcher that can be used in the 'paths' section
type HTTPFetcher ¶
type HTTPFetcher struct { Name string FetcherType string UserName string Password string Secure bool RestrictHosts []string RestrictPaths []string }
HTTPFetcher fetches content from http/https sources
func NewHTTPFetcher ¶
func NewHTTPFetcher(cfg map[string]interface{}) *HTTPFetcher
NewHTTPFetcher creates a new fetcher that support http/https
func (*HTTPFetcher) GetFetcherType ¶
func (fetcher *HTTPFetcher) GetFetcherType() string
GetFetcherType returns the type of this fetcher to be used in the 'type' properties when defining fetchers
func (*HTTPFetcher) GetName ¶
func (fetcher *HTTPFetcher) GetName() string
GetName returns the name assigned to this fetcher that can be used in the 'paths' section
type LocalFetcher ¶
LocalFetcher fetches content from http/https sources
func NewLocalFetcher ¶
func NewLocalFetcher(cfg map[string]interface{}) *LocalFetcher
NewLocalFetcher creates a new fetcher that support http/https
func (*LocalFetcher) GetFetcherType ¶
func (fetcher *LocalFetcher) GetFetcherType() string
GetFetcherType returns the type of this fetcher to be used in the 'type' properties when defining fetchers
func (*LocalFetcher) GetName ¶
func (fetcher *LocalFetcher) GetName() string
GetName returns the name assigned to this fetcher that can be used in the 'paths' section
type S3Fetcher ¶
type S3Fetcher struct { Name string FetcherType string Region string AccessKeyID string SecretAccessKey string }
S3Fetcher fetches content from an s3 bucket
func NewS3Fetcher ¶
NewS3Fetcher creates a new fetcher that support s3 bucket
func (*S3Fetcher) Fetch ¶
Fetch returns content from the local machine
It supports the following S3 URL format: - path style: s3://s3-aws-region.amazonaws.com/bucket/path/file - path style without region: s3://s3.amazonaws.com/bucket/path/file - default region must be configured in the configuration The bucket and path will be extracted from the URL.
If you are accessing an S3 file that is accessible via anonymous direct HTTP/S consider using the http fetcher.
func (*S3Fetcher) GetFetcherType ¶
GetFetcherType returns the type of this fetcher to be used in the 'type' properties when defining fetchers