store

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package store 는 백업 산출물 저장소 어댑터다.

설계: docs/11_기능설계/Nullus_백업복구_설계.md §4.2 (nullus-plan#75)

목적지는 **대상 클러스터 밖**의 S3 호환 오브젝트 스토리지다. 클러스터· 노드·스토리지가 통째로 사라져도 백업본은 남아야 하기 때문이다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint  string
	AccessKey string
	SecretKey string
	Bucket    string
	Region    string
	UseSSL    bool
	// Prefix 는 버킷 안의 최상위 경로다. 여러 환경이 한 버킷을 나눠 쓸 때 쓴다.
	Prefix string
}

type S3Store

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

func New

func New(cfg Config) (*S3Store, error)

func (*S3Store) Delete

func (s *S3Store) Delete(ctx context.Context, prefix string) error

Delete 는 접두사 아래를 전부 지운다 (한 백업 실행의 산출물 묶음).

func (*S3Store) Get

func (s *S3Store) Get(ctx context.Context, key string) (io.ReadCloser, error)

func (*S3Store) Preflight

func (s *S3Store) Preflight(ctx context.Context, requiredBytes int64) error

Preflight 는 정지 창에 들어가기 전에 목적지를 검사한다.

정지 창을 소비하고도 산출물을 못 만드는 것이 최악의 조합이므로 (§9 F7b·F8), 연결·인증·쓰기 권한을 **멈추기 전에** 확인한다.

func (*S3Store) Put

func (s *S3Store) Put(ctx context.Context, key string, r io.Reader) (port.PutResult, error)

Put 은 스트리밍으로 올리면서 sha256 을 함께 계산한다.

크기를 미리 모르므로 -1 을 넘긴다. minio-go 가 멀티파트로 나눠 올린다.

func (*S3Store) Stat

func (s *S3Store) Stat(ctx context.Context, key string) (int64, string, error)

Jump to

Keyboard shortcuts

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