Documentation
¶
Index ¶
- Variables
- type ConfigSyncer
- type EncryptedNamespace
- type Encryptor
- type Namespace
- type NotFoundError
- type ProviderService
- type Repository
- type Service
- func (s *Service) Create(ctx context.Context, ns *Namespace) error
- func (s *Service) Delete(ctx context.Context, id uint64) error
- func (s *Service) Get(ctx context.Context, id uint64) (*Namespace, error)
- func (s *Service) List(ctx context.Context) ([]Namespace, error)
- func (s *Service) Update(ctx context.Context, ns *Namespace) error
- type Transactor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicate = errors.New("urn and provider pair already exist") ErrRelation = errors.New("provider id does not exist") )
Functions ¶
This section is empty.
Types ¶
type ConfigSyncer ¶ added in v0.5.0
type EncryptedNamespace ¶
type Encryptor ¶
type Encryptor interface {
Encrypt(str secret.MaskableString) (secret.MaskableString, error)
Decrypt(str secret.MaskableString) (secret.MaskableString, error)
}
type Namespace ¶
type Namespace struct {
ID uint64 `json:"id"`
URN string `json:"urn"`
Name string `json:"name"`
Provider provider.Provider `json:"provider"`
Credentials map[string]interface{} `json:"credentials"`
Labels map[string]string `json:"labels"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type NotFoundError ¶
type NotFoundError struct {
ID uint64
}
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type ProviderService ¶ added in v0.5.0
type Repository ¶
type Repository interface {
Transactor
List(context.Context) ([]EncryptedNamespace, error)
Create(context.Context, *EncryptedNamespace) error
Get(context.Context, uint64) (*EncryptedNamespace, error)
Update(context.Context, *EncryptedNamespace) error
Delete(context.Context, uint64) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService(cryptoClient Encryptor, repository Repository, providerService ProviderService, registry map[string]ConfigSyncer) *Service
NewService returns secure service struct
Click to show internal directories.
Click to hide internal directories.