* util/tar: add archive util funcs * runtime: add store, builder options * runtime/local: update RuntimeSource func * runtime/builder/golang: use tar util * store/s3: make keys safe * runtime: add entrypoint options * runtime/builder: remove debugging * wip: integrate builder into k8s runtime * runtime/builder/golang: build for a linux architecture * runtime/kubernetes: write builds to the users namespace * runtime/local/source: fixes for mono-repo builds * runtime/local: stop checking out source (the responsibility is on the client) * runtime/builder: fix golang tests * runtime/local: fix out of bounds panic * Update * revert changes * runtime/local/source: refactor git package (wip) * runtime/kubernetes: map err not found * fix TestRunGenericRemote test * runtime/local: fix update not reassining source * Tidy go mod * runtime.Pending => runtime.Starting * store/s3: only use credentials option when set * store/s3: add tls config option
		
			
				
	
	
		
			53 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
package s3
 | 
						|
 | 
						|
import "crypto/tls"
 | 
						|
 | 
						|
// Options used to configure the s3 blob store
 | 
						|
type Options struct {
 | 
						|
	Endpoint        string
 | 
						|
	Region          string
 | 
						|
	AccessKeyID     string
 | 
						|
	SecretAccessKey string
 | 
						|
	Secure          bool
 | 
						|
	TLSConfig       *tls.Config
 | 
						|
}
 | 
						|
 | 
						|
// Option configures one or more options
 | 
						|
type Option func(o *Options)
 | 
						|
 | 
						|
// Endpoint sets the endpoint option
 | 
						|
func Endpoint(e string) Option {
 | 
						|
	return func(o *Options) {
 | 
						|
		o.Endpoint = e
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
// Region sets the region option
 | 
						|
func Region(r string) Option {
 | 
						|
	return func(o *Options) {
 | 
						|
		o.Region = r
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
// Credentials sets the AccessKeyID and SecretAccessKey options
 | 
						|
func Credentials(id, secret string) Option {
 | 
						|
	return func(o *Options) {
 | 
						|
		o.AccessKeyID = id
 | 
						|
		o.SecretAccessKey = secret
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
// Insecure sets the secure option to false. It is enabled by default.
 | 
						|
func Insecure() Option {
 | 
						|
	return func(o *Options) {
 | 
						|
		o.Secure = false
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
// TLSConfig sets the tls config for the client
 | 
						|
func TLSConfig(c *tls.Config) Option {
 | 
						|
	return func(o *Options) {
 | 
						|
		o.TLSConfig = c
 | 
						|
	}
 | 
						|
}
 |