Documentation
¶
Index ¶
- Variables
- func NewCredentialHandler(credential CredentialService, generic services.GenericService) *credentialHandler
- func NewMockCredentialDao() *credentialDaoMock
- func PresentCredential(credential *Credential) openapi.Credential
- func PresentCredentialToken(credential *Credential) openapi.CredentialTokenResponse
- type Credential
- type CredentialDao
- type CredentialIndex
- type CredentialList
- type CredentialPatchRequest
- type CredentialService
- type ServiceLocator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DisableAdvisoryLock = false UseBlockingAdvisoryLock = true )
Functions ¶
func NewCredentialHandler ¶
func NewCredentialHandler(credential CredentialService, generic services.GenericService) *credentialHandler
func NewMockCredentialDao ¶
func NewMockCredentialDao() *credentialDaoMock
func PresentCredential ¶
func PresentCredential(credential *Credential) openapi.Credential
func PresentCredentialToken ¶
func PresentCredentialToken(credential *Credential) openapi.CredentialTokenResponse
Types ¶
type Credential ¶
type Credential struct {
api.Meta
Name string `json:"name"`
Description *string `json:"description"`
Provider string `json:"provider"`
Token *string `json:"token"`
Url *string `json:"url"`
Email *string `json:"email"`
Labels *string `json:"labels"`
Annotations *string `json:"annotations"`
}
func ConvertCredential ¶
func ConvertCredential(credential openapi.Credential) *Credential
func (*Credential) BeforeCreate ¶
func (d *Credential) BeforeCreate(tx *gorm.DB) error
type CredentialDao ¶
type CredentialDao interface {
Get(ctx context.Context, id string) (*Credential, error)
Create(ctx context.Context, credential *Credential) (*Credential, error)
Replace(ctx context.Context, credential *Credential) (*Credential, error)
Delete(ctx context.Context, id string) error
FindByIDs(ctx context.Context, ids []string) (CredentialList, error)
All(ctx context.Context) (CredentialList, error)
}
func NewCredentialDao ¶
func NewCredentialDao(sessionFactory *db.SessionFactory) CredentialDao
type CredentialIndex ¶
type CredentialIndex map[string]*Credential
type CredentialList ¶
type CredentialList []*Credential
func (CredentialList) Index ¶
func (l CredentialList) Index() CredentialIndex
type CredentialPatchRequest ¶
type CredentialPatchRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Provider *string `json:"provider,omitempty"`
Token *string `json:"token,omitempty"`
Url *string `json:"url,omitempty"`
Email *string `json:"email,omitempty"`
Labels *string `json:"labels,omitempty"`
Annotations *string `json:"annotations,omitempty"`
}
type CredentialService ¶
type CredentialService interface {
Get(ctx context.Context, id string) (*Credential, *errors.ServiceError)
Create(ctx context.Context, credential *Credential) (*Credential, *errors.ServiceError)
Replace(ctx context.Context, credential *Credential) (*Credential, *errors.ServiceError)
Delete(ctx context.Context, id string) *errors.ServiceError
All(ctx context.Context) (CredentialList, *errors.ServiceError)
FindByIDs(ctx context.Context, ids []string) (CredentialList, *errors.ServiceError)
OnUpsert(ctx context.Context, id string) error
OnDelete(ctx context.Context, id string) error
}
func NewCredentialService ¶
func NewCredentialService(lockFactory db.LockFactory, credentialDao CredentialDao, events services.EventService) CredentialService
func Service ¶
func Service(s *environments.Services) CredentialService
type ServiceLocator ¶
type ServiceLocator func() CredentialService
func NewServiceLocator ¶
func NewServiceLocator(env *environments.Env) ServiceLocator
Click to show internal directories.
Click to hide internal directories.