Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectContentType ¶
DetectContentType makes a best-effort guess based on file extension.
Types ¶
type Config ¶
type Config struct {
Kind Kind `json:"kind"`
Filesystem *FilesystemConfig `json:"filesystem,omitempty"`
GitHub *GitHubConfig `json:"github,omitempty"`
HTTP *HTTPConfig `json:"http,omitempty"`
}
Config is the persisted, source-kind-specific configuration for a Resource.
type FetchRequest ¶
type FetchResult ¶
type Fetcher ¶
type Fetcher interface {
Fetch(ctx context.Context, req FetchRequest) (FetchResult, error)
}
Fetcher is the common abstraction every source adapter implements.
type FilesystemConfig ¶
type FilesystemConfig struct {
Path string `json:"path"`
}
type GitHubConfig ¶
type HTTPConfig ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry dispatches a FetchRequest to the Fetcher registered for its Kind.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Fetch ¶
func (r *Registry) Fetch(ctx context.Context, req FetchRequest) (FetchResult, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package http fetches content from a generic HTTP(S) endpoint.
|
Package http fetches content from a generic HTTP(S) endpoint. |
Click to show internal directories.
Click to hide internal directories.