Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags = []cli.Flag{ &cli.StringFlag{ Name: "cache.driver", Usage: "driver to be used for the cache", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_CACHE_DRIVER"), cli.EnvVar("CACHE_DRIVER"), cli.File("/vela/cache/driver"), ), Required: true, }, &cli.StringFlag{ Name: "cache.addr", Usage: "fully qualified url (<scheme>://<host>) for the cache", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_CACHE_ADDR"), cli.EnvVar("CACHE_ADDR"), cli.File("/vela/cache/addr"), ), Action: func(_ context.Context, _ *cli.Command, v string) error { if !strings.Contains(v, "://") { return fmt.Errorf("cache address must be fully qualified (<scheme>://<host>)") } if strings.HasSuffix(v, "/") { return fmt.Errorf("cache address must not have trailing slash") } return nil }, }, &cli.BoolFlag{ Name: "cache.cluster", Usage: "enables connecting to a cache cluster", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_CACHE_CLUSTER"), cli.EnvVar("CACHE_CLUSTER"), cli.File("/vela/cache/cluster"), ), }, &cli.StringFlag{ Name: "cache.install-token-key", Usage: "set cache install token key", Sources: cli.NewValueSourceChain( cli.EnvVar("VELA_CACHE_INSTALL_TOKEN_KEY"), cli.EnvVar("CACHE_INSTALL_TOKEN_KEY"), cli.File("/vela/cache/install_token_key"), ), Required: true, }, }
Flags represents all supported command line interface (CLI) flags for the queue.
Functions ¶
func WithGinContext ¶
WithGinContext inserts the cache Service into the gin.Context.
Types ¶
type Service ¶
type Service interface {
// Driver defines a function that outputs
// the configured queue driver.
Driver() string
StoreInstallToken(ctx context.Context, token *models.InstallToken, build int64, timeout int32) error
GetInstallToken(ctx context.Context, token string) (*models.InstallToken, error)
EvictInstallToken(ctx context.Context, token string) error
EvictBuildInstallTokens(ctx context.Context, build int64) error
StoreInstallStatusToken(ctx context.Context, build int64, token string) error
GetInstallStatusToken(ctx context.Context, build int64) (string, error)
EvictInstallStatusToken(ctx context.Context, build int64) error
StorePermissionToken(ctx context.Context, installID int64, token string) error
GetPermissionToken(ctx context.Context, installID int64) (string, error)
}
Service represents the interface for Vela integrating with the different supported Queue backends.
func FromCLICommand ¶
FromCLICommand helper function to setup the queue from the CLI arguments.
func FromContext ¶
FromContext retrieves the cache Service from the context.Context.
func FromGinContext ¶
FromGinContext retrieves the cache Service from the gin.Context.
type Setup ¶
type Setup struct {
// specifies the driver to use for the queue client
Driver string
// specifies the address to use for the queue client
Address string
// enables the queue client to integrate with a queue cluster
Cluster bool
InstallTokenKey string
}
Setup represents the configuration necessary for creating a Vela service capable of integrating with a configured queue environment.
Click to show internal directories.
Click to hide internal directories.