Documentation
¶
Overview ¶
Package repository 는 알림 채널과 발송 이력의 Postgres 구현이다.
Index ¶
- Variables
- type MemoryChannelRepository
- func (r *MemoryChannelRepository) Create(_ context.Context, ch *domain.Channel) error
- func (r *MemoryChannelRepository) Delete(_ context.Context, orgID, id string) error
- func (r *MemoryChannelRepository) Get(_ context.Context, orgID, id string) (*domain.Channel, error)
- func (r *MemoryChannelRepository) List(_ context.Context, orgID string) ([]*domain.Channel, error)
- func (r *MemoryChannelRepository) Update(_ context.Context, ch *domain.Channel) error
- type MemoryDeliveryRepository
- type PostgresChannelRepository
- func (r *PostgresChannelRepository) Create(ctx context.Context, ch *domain.Channel) error
- func (r *PostgresChannelRepository) Delete(ctx context.Context, orgID, id string) error
- func (r *PostgresChannelRepository) Get(ctx context.Context, orgID, id string) (*domain.Channel, error)
- func (r *PostgresChannelRepository) List(ctx context.Context, orgID string) ([]*domain.Channel, error)
- func (r *PostgresChannelRepository) MigrateLegacySecrets(ctx context.Context) (int, error)
- func (r *PostgresChannelRepository) Update(ctx context.Context, ch *domain.Channel) error
- type PostgresDeliveryRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEncryptionKeyMissing = errors.New("ENCRYPTION_KEY 가 없거나 32바이트가 아닙니다 — 알림 채널의 비밀을 암호화할 수 없습니다")
ErrEncryptionKeyMissing 는 비밀을 저장·복원하려는데 ENCRYPTION_KEY 가 없거나 32바이트가 아닐 때다.
Functions ¶
This section is empty.
Types ¶
type MemoryChannelRepository ¶
type MemoryChannelRepository struct {
// contains filtered or unexported fields
}
MemoryChannelRepository 는 DB 없이 도는 테스트용 채널 저장소다.
func NewMemoryChannelRepository ¶
func NewMemoryChannelRepository() *MemoryChannelRepository
func (*MemoryChannelRepository) Delete ¶
func (r *MemoryChannelRepository) Delete(_ context.Context, orgID, id string) error
type MemoryDeliveryRepository ¶
type MemoryDeliveryRepository struct {
// contains filtered or unexported fields
}
MemoryDeliveryRepository 는 DB 없이 도는 테스트용 발송 이력이다.
func NewMemoryDeliveryRepository ¶
func NewMemoryDeliveryRepository() *MemoryDeliveryRepository
type PostgresChannelRepository ¶
type PostgresChannelRepository struct {
// contains filtered or unexported fields
}
PostgresChannelRepository 는 notification_configs 다. 비밀은 secret_encrypted 에 암호화해 둔다.
func NewPostgresChannelRepository ¶
func NewPostgresChannelRepository(pool *pgxpool.Pool, encryptionKey []byte) *PostgresChannelRepository
func (*PostgresChannelRepository) Delete ¶
func (r *PostgresChannelRepository) Delete(ctx context.Context, orgID, id string) error
func (*PostgresChannelRepository) MigrateLegacySecrets ¶
func (r *PostgresChannelRepository) MigrateLegacySecrets(ctx context.Context) (int, error)
MigrateLegacySecrets 는 000096 전에 config 에 평문으로 저장된 비밀을 secret_encrypted 로 옮겨 암호화하고 config 에서 지운다. 옮긴 행 수를 돌려준다. 키가 없으면 아무것도 하지 않는다.
type PostgresDeliveryRepository ¶
type PostgresDeliveryRepository struct {
// contains filtered or unexported fields
}
PostgresDeliveryRepository 는 notification_history 다.
func NewPostgresDeliveryRepository ¶
func NewPostgresDeliveryRepository(pool *pgxpool.Pool) *PostgresDeliveryRepository
Click to show internal directories.
Click to hide internal directories.