Documentation ¶
Index ¶
Constants ¶
View Source
const ( CtxKeyPipelineSource = "pipelineSource" CtxKeyForceDelete = "forceDelete" )
View Source
const PipelineAppConfigNameSpacePrefix = "pipeline-secrets-app"
Variables ¶
View Source
var ( DefaultOperationsForKV = db.DefaultOperationsForKV DefaultOperationsForDiceFiles = db.DefaultOperationsForDiceFiles )
View Source
var ( ConfigTypeKV = db.ConfigTypeKV ConfigTypeDiceFile = db.ConfigTypeDiceFile )
View Source
var EnvTransferValidator strutil.Validator = func(s string) error { env := strings.Replace(strings.Replace(strings.ToUpper(s), ".", "_", -1), "-", "_", -1) if err := strutil.Validate(env, strutil.EnvKeyValidator); err != nil { return errors.Errorf("failed to transfer config key to env key, config key: %s, env key: %s, err: %v", s, env, err) } return nil }
View Source
var KeyValidator strutil.Validator = func(s string) error { keyRegexp := `^[a-zA-Z_]+[.a-zA-Z0-9_-]*$` valid := regexp.MustCompilePOSIX(keyRegexp).MatchString(s) if !valid { return fmt.Errorf("valid key regexp: %s", keyRegexp) } return nil }
Functions ¶
func NewPipelineCms ¶
func NewPipelineCms(dbClient *db.Client, rsaCrypt *encryption.RsaCrypt) *pipelineCm
Types ¶
type ConfigManager ¶
type ConfigManager interface { // IdempotentCreateNs create ns idempontently IdempotentCreateNs(ctx context.Context, ns string) error // IdempotentDeleteNs delete ns and its configs idempotently IdempotentDeleteNs(ctx context.Context, ns string) error // PrefixListNs list ns by prefix PrefixListNs(ctx context.Context, nsPrefix string) ([]*pb.PipelineCmsNs, error) // UpdateConfigs create if not exists; update if already exist UpdateConfigs(ctx context.Context, ns string, kvs map[string]*pb.PipelineCmsConfigValue) error // DeleteConfigs delete configs by keys; if ns not exists, return nil DeleteConfigs(ctx context.Context, ns string, keys ...string) error // GetConfigs get configs: if ns is empty, return nil; if keys is not empty, return specified configs GetConfigs(ctx context.Context, ns string, globalDecrypt bool, keys ...*pb.PipelineCmsConfigKey) (map[string]*pb.PipelineCmsConfigValue, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.