Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Local ¶
type Local struct { UploadDirectory string SourceDirectory string // contains filtered or unexported fields }
Local stores files locally on disk
func NewLocal ¶
NewLocal creates a local filestore and starts listening on a port assigned by the operating system. The files are stored on local disk on the server. The uploadDir is used for storing uploads, files are moved to the sourceDir when persisted. The directories are created if they don't already exist.
func (*Local) NewUploadURL ¶
NewUploadURL creates a new upload url that the local filestore will handle.
type S3 ¶
type S3 struct { Client s3iface.S3API UploadBucket string UploadExpiry time.Duration SourceBucket string }
S3 stores files in AWS S3
func NewS3 ¶
func NewS3(conf *aws.Config, uploadBucket string, uploadExpiry time.Duration, sourceBucket string) (*S3, error)
NewS3 creates a new S3 client
func (*S3) NewUploadURL ¶
NewUploadURL generates a new presigned URL on S3 for upload. The url is signed with the credentials provided to the client. The upload expires automatically. The url points to the upload bucket, the name argument specified the file name.
type SourceReader ¶
type SourceReader interface { // GetFile gets a file from the filestore GetFile(filename string) (*os.File, error) }
SourceReader reads source code from the filestore.
type SourceTarget ¶
type SourceTarget interface { // NewUploadURL generates a new URL that the source can be uploaded to. NewUploadURL(name string) (string, error) // Persist persists an uploaded file. Persist(ctx context.Context, name string) error }
SourceTarget is a target that accepts source code uploads.