repository

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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) Create

func (r *MemoryClusterRepository) Create(_ context.Context, cluster *domain.Cluster) error

Create stores a new cluster.

func (*MemoryClusterRepository) Delete

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 (r *MemoryClusterRepository) GetKubeconfig(_ context.Context, id string) ([]byte, error)

func (*MemoryClusterRepository) List

List returns all clusters for the given orgID. Passing an empty orgID returns all clusters.

func (*MemoryClusterRepository) SaveKubeconfig

func (r *MemoryClusterRepository) SaveKubeconfig(_ context.Context, id string, kubeconfig []byte) error

func (*MemoryClusterRepository) Update

func (r *MemoryClusterRepository) Update(_ context.Context, cluster *domain.Cluster) error

Update replaces a stored cluster.

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

Create stores a new organization.

func (*MemoryOrgRepository) GetByID

GetByID retrieves an organization by ID. Returns nil, nil when not found.

func (*MemoryOrgRepository) GetBySlug

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

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) Create

func (r *PostgresClusterRepository) Create(ctx context.Context, cluster *domain.Cluster) error

Create inserts a new cluster into the database.

func (*PostgresClusterRepository) Delete

Delete removes a cluster by ID.

func (*PostgresClusterRepository) GetByID

GetByID retrieves a cluster by its ID. Returns nil if not found.

func (*PostgresClusterRepository) GetKubeconfig

func (r *PostgresClusterRepository) GetKubeconfig(ctx context.Context, id string) ([]byte, error)

func (*PostgresClusterRepository) List

List retrieves clusters. If orgID is empty, returns all clusters.

func (*PostgresClusterRepository) SaveKubeconfig

func (r *PostgresClusterRepository) SaveKubeconfig(ctx context.Context, id string, kubeconfig []byte) error

func (*PostgresClusterRepository) Update

func (r *PostgresClusterRepository) Update(ctx context.Context, cluster *domain.Cluster) error

Update persists changes to an existing cluster, including the discovery-derived NodeArchitectures slice.

type PostgresKnownIssuesRepository

type PostgresKnownIssuesRepository struct {
	// contains filtered or unexported fields
}

func NewPostgresKnownIssuesRepository

func NewPostgresKnownIssuesRepository(pool *pgxpool.Pool) *PostgresKnownIssuesRepository

func (*PostgresKnownIssuesRepository) List

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

Create inserts a new organization into the database.

func (*PostgresOrgRepository) GetByID

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

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 (*PostgresResourceProfileRepository) Delete

func (r *PostgresResourceProfileRepository) Delete(ctx context.Context, orgID, id string) error

func (*PostgresResourceProfileRepository) List

func (*PostgresResourceProfileRepository) Update

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 (*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) AddMember

func (r *PostgresUserRepository) AddMember(ctx context.Context, orgID, userID string, role domain.Role) error

func (*PostgresUserRepository) Create

func (r *PostgresUserRepository) Create(ctx context.Context, user *domain.User) error

Create inserts a new user into the database.

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

func (r *PostgresUserRepository) GetByID(ctx context.Context, id string) (*domain.User, error)

GetByID retrieves a user by their ID. Returns nil if not found.

func (*PostgresUserRepository) IsMember

func (r *PostgresUserRepository) IsMember(ctx context.Context, orgID, userID string) (bool, error)

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

func (r *PostgresUserRepository) SearchByEmail(ctx context.Context, email string) (*domain.User, error)

func (*PostgresUserRepository) Update

func (r *PostgresUserRepository) Update(ctx context.Context, user *domain.User) error

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

func (*StackSecretResolver) Resolve

func (r *StackSecretResolver) Resolve(ctx context.Context, provider, stackID string) (secrets.Store, error)

Jump to

Keyboard shortcuts

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