Documentation
¶
Index ¶
- type ClusterWorkloadRestarter
- type KubeconfigDecryptor
- type MemoryClusterRepository
- func (r *MemoryClusterRepository) Create(_ context.Context, cluster *domain.Cluster) error
- func (r *MemoryClusterRepository) Delete(_ context.Context, id string) error
- func (r *MemoryClusterRepository) GetByID(_ context.Context, id string) (*domain.Cluster, error)
- func (r *MemoryClusterRepository) GetKubeconfig(_ context.Context, id string) ([]byte, error)
- func (r *MemoryClusterRepository) List(_ context.Context, orgID string) ([]*domain.Cluster, error)
- func (r *MemoryClusterRepository) SaveKubeconfig(_ context.Context, id string, kubeconfig []byte) error
- func (r *MemoryClusterRepository) Update(_ context.Context, cluster *domain.Cluster) error
- type MemoryOrgRepository
- func (r *MemoryOrgRepository) Create(_ context.Context, org *domain.Organization) error
- func (r *MemoryOrgRepository) GetByID(_ context.Context, id string) (*domain.Organization, error)
- func (r *MemoryOrgRepository) GetBySlug(_ context.Context, slug string) (*domain.Organization, error)
- func (r *MemoryOrgRepository) List(_ context.Context, limit, offset int) ([]*domain.Organization, error)
- func (r *MemoryOrgRepository) Update(_ context.Context, org *domain.Organization) error
- type PostgresClusterRepository
- func (r *PostgresClusterRepository) Create(ctx context.Context, cluster *domain.Cluster) error
- func (r *PostgresClusterRepository) Delete(ctx context.Context, id string) error
- func (r *PostgresClusterRepository) GetByID(ctx context.Context, id string) (*domain.Cluster, error)
- func (r *PostgresClusterRepository) GetKubeconfig(ctx context.Context, id string) ([]byte, error)
- func (r *PostgresClusterRepository) List(ctx context.Context, orgID string) ([]*domain.Cluster, error)
- func (r *PostgresClusterRepository) SaveKubeconfig(ctx context.Context, id string, kubeconfig []byte) error
- func (r *PostgresClusterRepository) Update(ctx context.Context, cluster *domain.Cluster) error
- type PostgresKnownIssuesRepository
- type PostgresOrgRepository
- func (r *PostgresOrgRepository) Create(ctx context.Context, org *domain.Organization) error
- func (r *PostgresOrgRepository) GetByID(ctx context.Context, id string) (*domain.Organization, error)
- func (r *PostgresOrgRepository) GetBySlug(ctx context.Context, slug string) (*domain.Organization, error)
- func (r *PostgresOrgRepository) List(ctx context.Context, limit, offset int) ([]*domain.Organization, error)
- func (r *PostgresOrgRepository) Update(ctx context.Context, org *domain.Organization) error
- type PostgresResourceProfileRepository
- func (r *PostgresResourceProfileRepository) Create(ctx context.Context, profile *domain.OrgResourceProfile) error
- func (r *PostgresResourceProfileRepository) Delete(ctx context.Context, orgID, id string) error
- func (r *PostgresResourceProfileRepository) List(ctx context.Context, orgID string) ([]*domain.OrgResourceProfile, error)
- func (r *PostgresResourceProfileRepository) Update(ctx context.Context, profile *domain.OrgResourceProfile) (bool, error)
- type PostgresTokenSourceRepository
- func (r *PostgresTokenSourceRepository) GetSource(ctx context.Context, tokenSourceID string) (*domain.TokenSource, error)
- func (r *PostgresTokenSourceRepository) InsertEvent(ctx context.Context, event *domain.TokenRotationEvent) error
- func (r *PostgresTokenSourceRepository) ListEvents(ctx context.Context, tokenSourceID string) ([]*domain.TokenRotationEvent, error)
- func (r *PostgresTokenSourceRepository) ListSources(ctx context.Context, orgID string) ([]*domain.TokenSource, error)
- func (r *PostgresTokenSourceRepository) UpdateSourceStatus(ctx context.Context, tokenSourceID, status string) error
- type PostgresUserRepository
- func (r *PostgresUserRepository) AddMember(ctx context.Context, orgID, userID string, role domain.Role) error
- func (r *PostgresUserRepository) Create(ctx context.Context, user *domain.User) error
- func (r *PostgresUserRepository) Delete(ctx context.Context, id string) error
- func (r *PostgresUserRepository) GetByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r *PostgresUserRepository) GetByID(ctx context.Context, id string) (*domain.User, error)
- func (r *PostgresUserRepository) IsMember(ctx context.Context, orgID, userID string) (bool, error)
- func (r *PostgresUserRepository) ListByOrg(ctx context.Context, orgID string) ([]*domain.User, error)
- func (r *PostgresUserRepository) SearchByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r *PostgresUserRepository) Update(ctx context.Context, user *domain.User) error
- type StackSecretResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterWorkloadRestarter ¶
type ClusterWorkloadRestarter struct {
// contains filtered or unexported fields
}
ClusterWorkloadRestarter 는 클러스터 ID 로 kubeconfig 를 찾아 해당 클러스터의 워크로드를 rolling restart 한다.
회전 스케줄러는 여러 스택을 다루므로 kubeconfig 가 고정될 수 없다. 대상 클러스터를 매번 해석하는 계층을 여기에 둔다.
func NewClusterWorkloadRestarter ¶
func NewClusterWorkloadRestarter(provider KubeconfigDecryptor) *ClusterWorkloadRestarter
func (*ClusterWorkloadRestarter) RestartForProvider ¶
func (r *ClusterWorkloadRestarter) RestartForProvider(ctx context.Context, clusterID, namespace, provider string) error
type KubeconfigDecryptor ¶
type KubeconfigDecryptor interface {
GetKubeconfig(ctx context.Context, clusterID string) ([]byte, error)
}
KubeconfigDecryptor 는 클러스터 ID 로 복호화된 kubeconfig 를 돌려준다.
type MemoryClusterRepository ¶
type MemoryClusterRepository struct {
// contains filtered or unexported fields
}
MemoryClusterRepository is an in-memory implementation of port.ClusterRepository. Intended for development and testing only.
func NewMemoryClusterRepository ¶
func NewMemoryClusterRepository() *MemoryClusterRepository
NewMemoryClusterRepository constructs an empty MemoryClusterRepository.
func (*MemoryClusterRepository) Delete ¶
func (r *MemoryClusterRepository) Delete(_ context.Context, id string) error
Delete removes a cluster by ID.
func (*MemoryClusterRepository) GetByID ¶
GetByID retrieves a cluster by ID. Returns nil, nil when not found.
func (*MemoryClusterRepository) GetKubeconfig ¶
func (*MemoryClusterRepository) List ¶
List returns all clusters for the given orgID. Passing an empty orgID returns all clusters.
func (*MemoryClusterRepository) SaveKubeconfig ¶
type MemoryOrgRepository ¶
type MemoryOrgRepository struct {
// contains filtered or unexported fields
}
MemoryOrgRepository is an in-memory implementation of port.OrgRepository. Intended for development and testing only.
func NewMemoryOrgRepository ¶
func NewMemoryOrgRepository() *MemoryOrgRepository
NewMemoryOrgRepository constructs an empty MemoryOrgRepository.
func (*MemoryOrgRepository) Create ¶
func (r *MemoryOrgRepository) Create(_ context.Context, org *domain.Organization) error
Create stores a new organization.
func (*MemoryOrgRepository) GetByID ¶
func (r *MemoryOrgRepository) GetByID(_ context.Context, id string) (*domain.Organization, error)
GetByID retrieves an organization by ID. Returns nil, nil when not found.
func (*MemoryOrgRepository) GetBySlug ¶
func (r *MemoryOrgRepository) GetBySlug(_ context.Context, slug string) (*domain.Organization, error)
GetBySlug retrieves an organization by slug. Returns nil, nil when not found.
func (*MemoryOrgRepository) List ¶
func (r *MemoryOrgRepository) List(_ context.Context, limit, offset int) ([]*domain.Organization, error)
func (*MemoryOrgRepository) Update ¶
func (r *MemoryOrgRepository) Update(_ context.Context, org *domain.Organization) error
Update replaces a stored organization.
type PostgresClusterRepository ¶
type PostgresClusterRepository struct {
// contains filtered or unexported fields
}
PostgresClusterRepository implements port.ClusterRepository using pgx.
func NewPostgresClusterRepository ¶
func NewPostgresClusterRepository(pool *pgxpool.Pool) *PostgresClusterRepository
NewPostgresClusterRepository creates a new PostgresClusterRepository.
func (*PostgresClusterRepository) Delete ¶
func (r *PostgresClusterRepository) Delete(ctx context.Context, id string) error
Delete removes a cluster by ID.
func (*PostgresClusterRepository) GetByID ¶
func (r *PostgresClusterRepository) GetByID(ctx context.Context, id string) (*domain.Cluster, error)
GetByID retrieves a cluster by its ID. Returns nil if not found.
func (*PostgresClusterRepository) GetKubeconfig ¶
func (*PostgresClusterRepository) List ¶
func (r *PostgresClusterRepository) List(ctx context.Context, orgID string) ([]*domain.Cluster, error)
List retrieves clusters. If orgID is empty, returns all clusters.
func (*PostgresClusterRepository) SaveKubeconfig ¶
type PostgresKnownIssuesRepository ¶
type PostgresKnownIssuesRepository struct {
// contains filtered or unexported fields
}
func NewPostgresKnownIssuesRepository ¶
func NewPostgresKnownIssuesRepository(pool *pgxpool.Pool) *PostgresKnownIssuesRepository
func (*PostgresKnownIssuesRepository) List ¶
func (r *PostgresKnownIssuesRepository) List(ctx context.Context) ([]port.KnownIssue, error)
type PostgresOrgRepository ¶
type PostgresOrgRepository struct {
// contains filtered or unexported fields
}
PostgresOrgRepository implements port.OrgRepository using pgx.
func NewPostgresOrgRepository ¶
func NewPostgresOrgRepository(pool *pgxpool.Pool) *PostgresOrgRepository
NewPostgresOrgRepository creates a new PostgresOrgRepository.
func (*PostgresOrgRepository) Create ¶
func (r *PostgresOrgRepository) Create(ctx context.Context, org *domain.Organization) error
Create inserts a new organization into the database.
func (*PostgresOrgRepository) GetByID ¶
func (r *PostgresOrgRepository) GetByID(ctx context.Context, id string) (*domain.Organization, error)
GetByID retrieves an organization by its ID. Returns nil if not found.
func (*PostgresOrgRepository) GetBySlug ¶
func (r *PostgresOrgRepository) GetBySlug(ctx context.Context, slug string) (*domain.Organization, error)
GetBySlug retrieves an organization by its slug. Returns nil if not found.
func (*PostgresOrgRepository) List ¶
func (r *PostgresOrgRepository) List(ctx context.Context, limit, offset int) ([]*domain.Organization, error)
func (*PostgresOrgRepository) Update ¶
func (r *PostgresOrgRepository) Update(ctx context.Context, org *domain.Organization) error
Update persists changes to an existing organization.
type PostgresResourceProfileRepository ¶
type PostgresResourceProfileRepository struct {
// contains filtered or unexported fields
}
func NewPostgresResourceProfileRepository ¶
func NewPostgresResourceProfileRepository(pool *pgxpool.Pool) *PostgresResourceProfileRepository
func (*PostgresResourceProfileRepository) Create ¶
func (r *PostgresResourceProfileRepository) Create(ctx context.Context, profile *domain.OrgResourceProfile) error
func (*PostgresResourceProfileRepository) Delete ¶
func (r *PostgresResourceProfileRepository) Delete(ctx context.Context, orgID, id string) error
func (*PostgresResourceProfileRepository) List ¶
func (r *PostgresResourceProfileRepository) List(ctx context.Context, orgID string) ([]*domain.OrgResourceProfile, error)
func (*PostgresResourceProfileRepository) Update ¶
func (r *PostgresResourceProfileRepository) Update(ctx context.Context, profile *domain.OrgResourceProfile) (bool, error)
type PostgresTokenSourceRepository ¶
type PostgresTokenSourceRepository struct {
// contains filtered or unexported fields
}
func NewPostgresTokenSourceRepository ¶
func NewPostgresTokenSourceRepository(pool *pgxpool.Pool) *PostgresTokenSourceRepository
func (*PostgresTokenSourceRepository) GetSource ¶
func (r *PostgresTokenSourceRepository) GetSource(ctx context.Context, tokenSourceID string) (*domain.TokenSource, error)
func (*PostgresTokenSourceRepository) InsertEvent ¶
func (r *PostgresTokenSourceRepository) InsertEvent(ctx context.Context, event *domain.TokenRotationEvent) error
func (*PostgresTokenSourceRepository) ListEvents ¶
func (r *PostgresTokenSourceRepository) ListEvents(ctx context.Context, tokenSourceID string) ([]*domain.TokenRotationEvent, error)
func (*PostgresTokenSourceRepository) ListSources ¶
func (r *PostgresTokenSourceRepository) ListSources(ctx context.Context, orgID string) ([]*domain.TokenSource, error)
func (*PostgresTokenSourceRepository) UpdateSourceStatus ¶
func (r *PostgresTokenSourceRepository) UpdateSourceStatus(ctx context.Context, tokenSourceID, status string) error
type PostgresUserRepository ¶
type PostgresUserRepository struct {
// contains filtered or unexported fields
}
PostgresUserRepository implements port.UserRepository using pgx.
func NewPostgresUserRepository ¶
func NewPostgresUserRepository(pool *pgxpool.Pool) *PostgresUserRepository
NewPostgresUserRepository creates a new PostgresUserRepository.
func (*PostgresUserRepository) Delete ¶
func (r *PostgresUserRepository) Delete(ctx context.Context, id string) error
func (*PostgresUserRepository) GetByEmail ¶
func (r *PostgresUserRepository) GetByEmail(ctx context.Context, email string) (*domain.User, error)
GetByEmail retrieves a user by their email. Returns nil if not found.
func (*PostgresUserRepository) GetByID ¶
GetByID retrieves a user by their ID. Returns nil if not found.
func (*PostgresUserRepository) ListByOrg ¶
func (r *PostgresUserRepository) ListByOrg(ctx context.Context, orgID string) ([]*domain.User, error)
ListByOrg retrieves all users belonging to a given organization.
func (*PostgresUserRepository) SearchByEmail ¶
type StackSecretResolver ¶
type StackSecretResolver struct {
// contains filtered or unexported fields
}
StackSecretResolver 는 스택 ID 로 해당 스택의 OpenBao Store 를 만든다.
OpenBao 는 스택마다 배포되므로 주소가 전역 하나일 수 없다. 스택 레코드에서 네임스페이스와 클러스터를 찾고, 그 클러스터의 kubeconfig 로 Kubernetes Auth 기반 Store 를 생성한다.
func NewStackSecretResolver ¶
func NewStackSecretResolver(pool *pgxpool.Pool, kubeconfigProvider KubeconfigDecryptor) *StackSecretResolver