credentials

package
v0.0.0-...-63545c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

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

type ServiceLocator

type ServiceLocator func() CredentialService

func NewServiceLocator

func NewServiceLocator(env *environments.Env) ServiceLocator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL