2020-11-17 05:41:34 +00:00
|
|
|
package registry
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
2020-11-30 05:16:25 +00:00
|
|
|
type ErrTemplateExists struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrTemplateExists) Error() string {
|
|
|
|
return fmt.Sprintf("template %s already exists", e.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsErrTemplateExists(err error) bool {
|
|
|
|
_, ok := err.(ErrTemplateExists)
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
2020-11-17 05:41:34 +00:00
|
|
|
type ErrTemplateNotFound struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrTemplateNotFound) Error() string {
|
|
|
|
return fmt.Sprintf("template not found for %s", e.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsErrTemplateNotFound(err error) bool {
|
|
|
|
_, ok := err.(ErrTemplateNotFound)
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
type ErrSourceNotFound struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ErrSourceNotFound) Error() string {
|
|
|
|
return fmt.Sprintf("Source not found for %s", e.Name)
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsErrSourceNotFound(err error) bool {
|
|
|
|
_, ok := err.(ErrSourceNotFound)
|
|
|
|
return ok
|
|
|
|
}
|