Documentation ¶
Index ¶
- Variables
- type Filter
- type NotFoundError
- type Provider
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, prov *Provider) error
- func (s *Service) Delete(ctx context.Context, id uint64) error
- func (s *Service) Get(ctx context.Context, id uint64) (*Provider, error)
- func (s *Service) List(ctx context.Context, flt Filter) ([]Provider, error)
- func (s *Service) Update(ctx context.Context, prov *Provider) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDuplicate = errors.New("urn already exist")
)
Functions ¶
This section is empty.
Types ¶
type NotFoundError ¶
type NotFoundError struct {
ID uint64
}
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type Provider ¶
type Provider struct { ID uint64 `json:"id"` URN string `json:"urn"` Host string `json:"host"` Name string `json:"name"` Type string `json:"type"` Credentials map[string]any `json:"credentials"` Labels map[string]string `json:"labels"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func FromV1beta1Proto ¶ added in v0.6.7
func FromV1beta1Proto(proto *sirenv1beta1.Provider) Provider
func (*Provider) ToV1beta1Proto ¶ added in v0.6.7
func (p *Provider) ToV1beta1Proto() (*sirenv1beta1.Provider, error)
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService(repository Repository, supportedProviders []string) *Service
NewService returns repository struct
Click to show internal directories.
Click to hide internal directories.