Documentation
¶
Index ¶
- func DeleteCachedTemplate(path string) error
- func DeleteLocalCacheDir(cacheDir string) (string, error)
- type CacheSourceOpts
- type GitSource
- type GitSourceOptions
- type LocalSource
- type RawTemplate
- type RemoteSource
- type SourceLoader
- func NewGitLoader[T TemplateType](opts *GitSourceOptions, name string) SourceLoader[T]
- func NewLocalCachedLoader[T TemplateType](path string, cacheDir string) SourceLoader[T]
- func NewLocalLoader[T TemplateType](path string) SourceLoader[T]
- func NewRemoteLoader[T TemplateType](url string, cacheDir string) SourceLoader[T]
- type SourceType
- type SourceValidator
- type TemplateInfo
- type TemplateType
- type TemplateValidated
- type TemplateValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCachedTemplate ¶ added in v0.8.0
func DeleteLocalCacheDir ¶ added in v0.8.0
Types ¶
type CacheSourceOpts ¶ added in v0.8.0
type CacheSourceOpts struct {
// contains filtered or unexported fields
}
type GitSource ¶ added in v0.8.0
type GitSource[T TemplateType] struct { // contains filtered or unexported fields }
func (*GitSource[T]) Parse ¶ added in v0.8.0
func (src *GitSource[T]) Parse() (*RawTemplate, error)
func (*GitSource[T]) Read ¶ added in v0.8.0
func (src *GitSource[T]) Read() (*TemplateInfo[T], error)
func (*GitSource[T]) Validate ¶ added in v0.8.0
func (src *GitSource[T]) Validate() ([]*TemplateValidated, error)
type GitSourceOptions ¶ added in v0.8.0
type GitSourceOptions struct { CacheBaseDir string RepositoryUrl string DefaultRevision string Revision string AllowOffline bool }
func (*GitSourceOptions) CacheDirName ¶ added in v0.8.0
func (s *GitSourceOptions) CacheDirName() string
func (*GitSourceOptions) CachePath ¶ added in v0.8.0
func (s *GitSourceOptions) CachePath() string
type LocalSource ¶ added in v0.6.0
type LocalSource[T TemplateType] struct { // contains filtered or unexported fields }
func (*LocalSource[T]) Parse ¶ added in v0.8.0
func (src *LocalSource[T]) Parse() (*RawTemplate, error)
func (*LocalSource[T]) Read ¶ added in v0.8.0
func (src *LocalSource[T]) Read() (*TemplateInfo[T], error)
func (*LocalSource[T]) Validate ¶ added in v0.8.0
func (src *LocalSource[T]) Validate() ([]*TemplateValidated, error)
type RawTemplate ¶ added in v0.8.0
type RawTemplate TemplateValue[string]
alias to fix receiver types with generics
func (*RawTemplate) ToJson ¶ added in v0.8.0
func (t *RawTemplate) ToJson() (*RawTemplate, error)
func (*RawTemplate) ToYaml ¶ added in v0.8.0
func (t *RawTemplate) ToYaml() (*RawTemplate, error)
type RemoteSource ¶ added in v0.6.0
type RemoteSource[T TemplateType] struct { // contains filtered or unexported fields }
func (*RemoteSource[T]) Parse ¶ added in v0.8.0
func (src *RemoteSource[T]) Parse() (*RawTemplate, error)
func (*RemoteSource[T]) Read ¶ added in v0.8.0
func (src *RemoteSource[T]) Read() (*TemplateInfo[T], error)
func (*RemoteSource[T]) Validate ¶ added in v0.8.0
func (src *RemoteSource[T]) Validate() ([]*TemplateValidated, error)
type SourceLoader ¶ added in v0.8.0
type SourceLoader[T TemplateType] interface { Read() (*TemplateInfo[T], error) }
func NewGitLoader ¶ added in v0.8.0
func NewGitLoader[T TemplateType](opts *GitSourceOptions, name string) SourceLoader[T]
func NewLocalCachedLoader ¶ added in v0.8.0
func NewLocalCachedLoader[T TemplateType](path string, cacheDir string) SourceLoader[T]
func NewLocalLoader ¶ added in v0.8.0
func NewLocalLoader[T TemplateType](path string) SourceLoader[T]
func NewRemoteLoader ¶ added in v0.8.0
func NewRemoteLoader[T TemplateType](url string, cacheDir string) SourceLoader[T]
type SourceType ¶ added in v0.8.0
type SourceType uint
const ( Local SourceType = iota Remote Git )
func (SourceType) String ¶ added in v0.8.0
func (s SourceType) String() string
type SourceValidator ¶ added in v0.8.0
type SourceValidator interface { Parse() (*RawTemplate, error) Validate() ([]*TemplateValidated, error) }
func NewGitValidator ¶ added in v0.8.0
func NewGitValidator(opts *GitSourceOptions, name string) SourceValidator
func NewLocalValidator ¶ added in v0.8.0
func NewLocalValidator(path string) SourceValidator
func NewRemoteValidator ¶ added in v0.8.0
func NewRemoteValidator(url string) SourceValidator
type TemplateInfo ¶ added in v0.8.0
type TemplateInfo[T TemplateType] struct { Value *TemplateValue[T] SourceType SourceType Path string // absolute path cached or resolved git path Revision string // local/remote or git commit }
type TemplateType ¶ added in v0.8.0
type TemplateValidated ¶ added in v0.6.0
type TemplateValidated struct { Value *RawTemplate Path string IsValid bool }
type TemplateValue ¶ added in v0.6.0
type TemplateValue[T TemplateType] struct { Kind schema.SchemaKind Data T // string or actual model }
Click to show internal directories.
Click to hide internal directories.