Help us shape the future of Go! Take the 2026 Go Developer Survey

objectstorage

package
v0.4.24 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProviderProject = "baseharbor-object-storage"
	ProviderService = "seaweedfs-node-1"
	ProviderNetwork = "baseharbor-object-storage"
	ProviderImage   = "docker.io/chrislusf/seaweedfs:4.47"
)

Variables

This section is empty.

Functions

func ApplyDevelopmentManagementUICredentialsAt added in v0.4.17

func ApplyDevelopmentManagementUICredentialsAt(ctx context.Context, runtime Runtime, dataDir, namespace, username, password string) error

func DestroySharedProvider

func DestroySharedProvider(ctx context.Context, runtime Runtime) error

func DestroySharedProviderAt added in v0.4.15

func DestroySharedProviderAt(ctx context.Context, runtime Runtime, dataDir, namespace string) error

func EnsureSharedProvider added in v0.4.8

func EnsureSharedProvider(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer) (ProviderFiles, AdminCredentials, string, error)

func EnsureSharedProviderAt added in v0.4.15

func EnsureSharedProviderAt(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer, dataDir, namespace string, intent ...availability.Requirement) (ProviderFiles, AdminCredentials, string, error)

func ExistingReadySharedProvider added in v0.4.15

func ExistingReadySharedProvider(ctx context.Context) (ProviderFiles, AdminCredentials, string, error)

func ExistingReadySharedProviderAt added in v0.4.15

func ExistingReadySharedProviderAt(ctx context.Context, dataDir, namespace string) (ProviderFiles, AdminCredentials, string, error)

func ManagementUISurfaceAt added in v0.4.17

func ManagementUISurfaceAt(dataDir, namespace string) (application.ManagementUISurface, error)

func PhysicalBucketName

func PhysicalBucketName(m application.Manifest, logical string) string

func RegisterManagementUIConsumerAt added in v0.4.17

func RegisterManagementUIConsumerAt(dataDir, namespace string, app application.Manifest) error

func RotatePlatformBucketCredentialsAt added in v0.4.21

func RotatePlatformBucketCredentialsAt(
	ctx context.Context,
	runtime Runtime,
	issuer serviceaccess.Issuer,
	dataDir, namespace, logicalName string,
	hooks PlatformBucketRotationHooks,
) error

RotatePlatformBucketCredentialsAt rotates one provider-owned S3 identity with explicit overlap. The replacement identity is created first, consumers are reconciled and verified against it, and only then is the previous IAM user retired and negatively verified.

func RotateProviderPKIAt added in v0.4.21

func RotateProviderPKIAt(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer, dataDir, namespace string) error

RotateProviderPKIAt reconciles SeaweedFS service and management TLS material against a replacement issuer, verifies both stable endpoints while the old and new trust roots overlap, and retires the previous trust root only after the replacement path is proven healthy.

func ServiceContainerEndpoint added in v0.4.15

func ServiceContainerEndpoint(files ProviderFiles) (string, error)

func ServiceTrustBundle added in v0.4.15

func ServiceTrustBundle(files ProviderFiles) (string, error)

func UnregisterManagementUIConsumerAt added in v0.4.17

func UnregisterManagementUIConsumerAt(dataDir, namespace string, app application.Manifest) error

func VerifyApplicationBuckets

func VerifyApplicationBuckets(ctx context.Context, runtime Runtime, app application.Manifest, files application.RuntimeFiles) error

func VerifyApplicationBucketsAt added in v0.4.15

func VerifyApplicationBucketsAt(ctx context.Context, runtime Runtime, app application.Manifest, files application.RuntimeFiles, dataDir, namespace string) error

func VerifyManagementUIAt added in v0.4.17

func VerifyManagementUIAt(ctx context.Context, dataDir, namespace string) error

Types

type AdminCredentials added in v0.4.8

type AdminCredentials struct {
	AccessKeyID     string
	SecretAccessKey string
}

func EnsureAdminCredentials added in v0.4.8

func EnsureAdminCredentials(files ProviderFiles) (AdminCredentials, string, error)

func LoadAdminCredentials added in v0.4.8

func LoadAdminCredentials(path string) (AdminCredentials, error)

func LoadContainerAdminCredentials added in v0.4.8

func LoadContainerAdminCredentials(path string) (AdminCredentials, error)

type BackupObject added in v0.4.16

type BackupObject struct {
	Key  string `json:"key"`
	Data []byte `json:"data"`
}

type BucketBackup added in v0.4.16

type BucketBackup struct {
	LogicalBucket string         `json:"logical_bucket"`
	Objects       []BackupObject `json:"objects"`
}

type Driver

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

func NewDriver

func NewDriver(runtime Runtime, app application.Manifest, files application.RuntimeFiles, issuer serviceaccess.Issuer) *Driver

func NewDriverAt added in v0.4.15

func NewDriverAt(runtime Runtime, app application.Manifest, files application.RuntimeFiles, issuer serviceaccess.Issuer, dataDir, namespace string) *Driver

func NewDriverWithRealization added in v0.4.19

func NewDriverWithRealization(realization SeaweedFSRealization, app application.Manifest, files application.RuntimeFiles) *Driver

func (*Driver) Bind

func (d *Driver) Bind(ctx context.Context, resource capability.Resource, _ capability.Binding) error

func (*Driver) Descriptor

func (d *Driver) Descriptor() capability.Provider

func (*Driver) DestroyBucket

func (d *Driver) DestroyBucket(ctx context.Context, logicalBucket string) error

func (*Driver) EnsureSharedProvider added in v0.4.8

func (d *Driver) EnsureSharedProvider(ctx context.Context) (ProviderFiles, AdminCredentials, string, error)

func (*Driver) ExportBucket added in v0.4.16

func (d *Driver) ExportBucket(ctx context.Context, logical string) (BucketBackup, error)

func (*Driver) Preflight

func (d *Driver) Preflight(_ context.Context, resource capability.Resource, binding capability.Binding) error

func (*Driver) Provision

func (d *Driver) Provision(ctx context.Context, resource capability.Resource, _ capability.Binding) error

func (*Driver) RestoreBucket added in v0.4.16

func (d *Driver) RestoreBucket(ctx context.Context, backup BucketBackup) error

func (*Driver) Rollback

func (d *Driver) Rollback(ctx context.Context)

func (*Driver) RotateBucketCredentials added in v0.4.21

func (d *Driver) RotateBucketCredentials(ctx context.Context, logicalBucket string) error

RotateBucketCredentials performs overlap-safe S3 credential rotation for one logical bucket. The new IAM identity exists before the application binding is changed. The old identity is retired only after a real Put/Get verification succeeds with the replacement credential pair.

func (*Driver) Verify

func (d *Driver) Verify(ctx context.Context, resource capability.Resource, _ capability.Binding) error

type IAMAccessKey added in v0.4.8

type IAMAccessKey struct {
	AccessKeyID     string
	SecretAccessKey string
}

type IAMClient added in v0.4.8

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

func NewIAMClient added in v0.4.8

func NewIAMClient(endpoint string, client *http.Client, credentials AdminCredentials) (*IAMClient, error)

func (*IAMClient) CreateAccessKey added in v0.4.8

func (c *IAMClient) CreateAccessKey(ctx context.Context, user string) (IAMAccessKey, error)

func (*IAMClient) CreateUser added in v0.4.8

func (c *IAMClient) CreateUser(ctx context.Context, user string) error

func (*IAMClient) DeleteAccessKey added in v0.4.8

func (c *IAMClient) DeleteAccessKey(ctx context.Context, user, accessKeyID string) error

func (*IAMClient) DeleteUser added in v0.4.8

func (c *IAMClient) DeleteUser(ctx context.Context, user string) error

func (*IAMClient) DeleteUserPolicy added in v0.4.8

func (c *IAMClient) DeleteUserPolicy(ctx context.Context, user, policyName string) error

func (*IAMClient) ListAccessKeys added in v0.4.8

func (c *IAMClient) ListAccessKeys(ctx context.Context, user string) ([]string, error)

func (*IAMClient) PutUserPolicy added in v0.4.8

func (c *IAMClient) PutUserPolicy(ctx context.Context, user, policyName, policyDocument string) error

type PlatformBucket added in v0.4.21

type PlatformBucket struct {
	Name            string
	Endpoint        string
	Network         string
	TrustBundle     string
	AccessKeyID     string
	SecretAccessKey string
}

PlatformBucket is a provider-owned S3 bucket used by another managed BaseHarbor provider (for example Loki or Tempo). It is intentionally separate from application object-storage intent and receives a dedicated least- privilege IAM identity.

func EnsurePlatformBucketAt added in v0.4.21

func EnsurePlatformBucketAt(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer, dataDir, namespace, logicalName string, intent ...availability.Requirement) (PlatformBucket, error)

func ExistingPlatformBucketAt added in v0.4.21

func ExistingPlatformBucketAt(dataDir, namespace, logicalName string) (PlatformBucket, error)

type PlatformBucketRotationHooks added in v0.4.21

type PlatformBucketRotationHooks struct {
	Reconcile func(context.Context, PlatformBucket) error
	Verify    func(context.Context, PlatformBucket) error
	Rollback  func(context.Context, PlatformBucket) error
}

type ProviderFiles

type ProviderFiles struct {
	Dir     string
	Compose string
	Env     string
	Project string
	Network string
}

func EnsureProviderFiles

func EnsureProviderFiles(ctx context.Context, issuer serviceaccess.Issuer) (ProviderFiles, error)

func EnsureProviderFilesAt added in v0.4.15

func EnsureProviderFilesAt(ctx context.Context, issuer serviceaccess.Issuer, dataDir, namespace string, intent ...availability.Requirement) (ProviderFiles, error)

func ExistingProviderFiles

func ExistingProviderFiles() (ProviderFiles, error)

func ExistingProviderFilesAt added in v0.4.15

func ExistingProviderFilesAt(dataDir, namespace string) (ProviderFiles, error)

type Runtime

type Runtime interface {
	ConfigProject(context.Context, string, string, string) error
	UpProject(context.Context, string, string, string) error
	ExecProject(context.Context, string, string, string, string, ...string) (string, error)
	ExecProjectInput(context.Context, string, string, string, []byte, string, ...string) (string, error)
	DestroyProject(context.Context, string, string, string) error
}

type RuntimeResourceBinding added in v0.4.8

type RuntimeResourceBinding struct {
	ResourceID      string `json:"resource_id"`
	Endpoint        string `json:"endpoint"`
	Bucket          string `json:"bucket"`
	Region          string `json:"region"`
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

type RuntimeResourceManager added in v0.4.8

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

func NewRuntimeResourceManager added in v0.4.8

func NewRuntimeResourceManager(dir, endpoint string, client *http.Client, admin AdminCredentials) (*RuntimeResourceManager, error)

func (*RuntimeResourceManager) Check added in v0.4.8

func (*RuntimeResourceManager) Create added in v0.4.8

func (m *RuntimeResourceManager) Create(ctx context.Context, applicationName, environment, name string) (RuntimeResourceBinding, error)

func (*RuntimeResourceManager) Delete added in v0.4.8

func (m *RuntimeResourceManager) Delete(ctx context.Context, applicationName, environment, name string) error

func (*RuntimeResourceManager) Get added in v0.4.8

func (m *RuntimeResourceManager) Get(ctx context.Context, applicationName, environment, name string) (RuntimeResourceBinding, error)

type SeaweedFSInstance added in v0.4.19

type SeaweedFSInstance struct {
	Endpoint         string
	WorkloadEndpoint string
	TrustBundle      []byte
	HTTPClient       *http.Client
}

SeaweedFSInstance is the runtime-neutral result consumed by the S3 capability lifecycle. Runtime-native resource names remain private to the realization.

type SeaweedFSRealization added in v0.4.19

type SeaweedFSRealization interface {
	Apply(context.Context) (SeaweedFSInstance, error)
	Existing(context.Context) (SeaweedFSInstance, error)
	Admin(context.Context, string) (string, error)
	Destroy(context.Context) error
}

SeaweedFSRealization owns runtime-specific provider deployment and administrative execution. The capability Driver must not require Compose, container, Kubernetes, OpenShift or cloud resource vocabulary.

Jump to

Keyboard shortcuts

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