Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags = []cli.Flag{ &cli.BoolFlag{ Name: "storage.enable", Usage: "enable object storage", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_ENABLE"), cli.File("vela/storage/enable"), ), }, &cli.StringFlag{ Name: "storage.driver", Usage: "object storage driver", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_DRIVER"), cli.EnvVar("STORAGE_DRIVER"), cli.File("vela/storage/driver"), ), }, &cli.StringFlag{ Name: "storage.addr", Usage: "set the storage endpoint (ex. scheme://host:port)", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_ADDRESS"), cli.EnvVar("STORAGE_ADDRESS"), cli.File("vela/storage/addr"), ), Action: func(_ context.Context, _ *cli.Command, v string) error { if !strings.Contains(v, "://") { return fmt.Errorf("storage address must be fully qualified (<scheme>://<host>)") } if strings.HasSuffix(v, "/") { return fmt.Errorf("storage address must not have trailing slash") } return nil }, }, &cli.StringFlag{ Name: "storage.access.key", Usage: "set storage access key", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_ACCESS_KEY"), cli.EnvVar("STORAGE_ACCESS_KEY"), cli.File("vela/storage/access_key"), ), }, &cli.StringFlag{ Name: "storage.secret.key", Usage: "set storage secret key", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_SECRET_KEY"), cli.EnvVar("STORAGE_SECRET_KEY"), cli.File("vela/storage/secret_key"), ), }, &cli.StringFlag{ Name: "storage.bucket.name", Usage: "set storage bucket name", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_STORAGE_BUCKET"), cli.File("vela/storage/bucket"), ), }, &cli.BoolFlag{ Name: "storage.use.ssl", Usage: "enable storage to use SSL", Value: false, Sources: cli.EnvVars("VELA_STORAGE_USE_SSL"), }, }
Functions ¶
func ToContext ¶
ToContext adds the secret Service to this context if it supports the Setter interface.
func WithContext ¶
WithContext adds the minio Storage to the context.
func WithGinContext ¶
WithGinContext inserts the minio Storage into the gin.Context.
Types ¶
type Setup ¶
type Setup struct {
Enable bool
Driver string
Endpoint string
AccessKey string
SecretKey string
Bucket string
Region string
Secure bool
Token string
}
Setup represents the configuration necessary for creating a Vela service capable of integrating with a configured S3 environment.
type Storage ¶
type Storage interface {
StatObject(context.Context, *api.Object) (*api.Object, error)
ListBuildObjectNames(context.Context, string, string, string) (map[string]string, error)
PresignedGetObject(context.Context, *api.Object) (string, error)
PresignedPutObject(context.Context, string, time.Duration) (string, error)
}
Storage defines the service interface for object storage operations.
func FromContext ¶
FromContext retrieves minio service from the context.
func FromGinContext ¶
FromGinContext retrieves the S3 Service from the gin.Context.
Click to show internal directories.
Click to hide internal directories.