s3

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Router

func Router(ctx context.Context, driver Driver, clientFactory ClientFactory) *mux.Router

`inputBuckets` specifies which buckets should be served, referencing specific commit IDs. If nil, all PFS branches will be served as separate buckets, of the form `<branch name>.<bucket name>`. Some s3 features are enabled when all PFS branches are served as well; e.g. we add support for some s3 versioning functionality.

This returns an `mux.Router` instance. It is the responsibility of the caller to configure a server to use this Router.

Note: In `s3cmd`, you must set the access key and secret key, even though this API will ignore them - otherwise, you'll get an opaque config error: https://github.com/s3tools/s3cmd/issues/845#issuecomment-464885959

Types

type Bucket

type Bucket struct {
	// Commit is the PFS commit that this bucket points to
	Commit *pfs.Commit
	// Name is the name of the bucket
	Name string
}

Bucket represents an S3 bucket

type ClientFactory

type ClientFactory = func(ctx context.Context) *client.APIClient

ClientFactory is a function called by s3g to create request-scoped pachyderm clients

type Driver

type Driver interface {
	// contains filtered or unexported methods
}

Driver implementations drive the underlying bucket-related functionality for an s3gateway instance

type MasterDriver

type MasterDriver struct{}

MasterDriver is the driver for the s3gateway instance running on pachd master

func NewMasterDriver

func NewMasterDriver() *MasterDriver

NewMasterDriver constructs a new master driver

type S3Server

type S3Server struct {
	*http.Server
	// contains filtered or unexported fields
}

In addition to providing the http server itself, S3Server exposes methods to configure handlers (mux.Routers) corresponding to different request URI hostnames. This way one http Server can respond differently and accordingly to each specific job.

func Server

func Server(ctx context.Context, port uint16, defaultRouter *mux.Router) *S3Server

Server runs an HTTP server with an S3-like API for PFS. This allows you to use s3 clients to access PFS contents.

func (*S3Server) AddRouter

func (s *S3Server) AddRouter(k string, r *mux.Router)

func (*S3Server) ContainsRouter

func (s *S3Server) ContainsRouter(k string) bool

func (*S3Server) RemoveRouter

func (s *S3Server) RemoveRouter(k string)

type WorkerDriver

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

WorkerDriver is the driver for the s3gateway instance running on pachd workers

func NewWorkerDriver

func NewWorkerDriver(inputBuckets []*Bucket, outputBucket *Bucket) *WorkerDriver

NewWorkerDriver creates a new worker driver. `inputBuckets` is a list of whitelisted buckets to be served from input repos. `outputBucket` is the whitelisted bucket to be served from an output repo. If `nil`, no output bucket will be available.

Jump to

Keyboard shortcuts

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