Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRepositories = errors.New("no spec repositories configured") ErrNotFound = errors.New("named spec not found") )
Functions ¶
This section is empty.
Types ¶
type AmbiguousError ¶
Example ¶
err := (&AmbiguousError{
Selector: "upgrade",
Choices: []Entry{
{Source: "https://git.example.com/acme/one", Path: "one.yaml"},
{Source: "https://git.example.com/acme/two", Path: "two.yaml"},
},
}).Error()
fmt.Println(err)
Output: named spec selector upgrade is ambiguous: https://git.example.com/acme/one:one.yaml, https://git.example.com/acme/two:two.yaml
func (*AmbiguousError) Error ¶
func (e *AmbiguousError) Error() string
type Catalog ¶
type Catalog interface {
List(context.Context) ([]Entry, error)
Resolve(context.Context, string) (Entry, error)
WithResolvedSource(context.Context, string, func(Entry, string) error) error
}
Catalog refreshes and resolves the configured Git-backed named-spec catalog.
type Entry ¶
type Entry struct {
Name string
Description string
Source string
Path string
SHA string
CommittedAt time.Time
// contains filtered or unexported fields
}
Entry identifies one named spec at the repository commit used for discovery.
type InvalidSelectorError ¶
type InvalidSelectorError struct {
Selector string
}
func (*InvalidSelectorError) Error ¶
func (e *InvalidSelectorError) Error() string
type Options ¶
type Options struct {
Repositories []domaintypes.RepoURL
CacheDir string
Auth gitauth.Options
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) WithResolvedSource ¶
func (s *Service) WithResolvedSource(ctx context.Context, selector string, use func(Entry, string) error) error
WithResolvedSource keeps the selected checkout at the resolved commit for the complete callback so a concurrent catalog refresh cannot change the files while the caller compiles them.
Click to show internal directories.
Click to hide internal directories.