...

Source file src/edge-infra.dev/pkg/edge/edge-issuer/controllers/interface.go

Documentation: edge-infra.dev/pkg/edge/edge-issuer/controllers

     1  package controllers
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"google.golang.org/api/option"
     8  
     9  	"edge-infra.dev/pkg/lib/gcp/secretmanager"
    10  )
    11  
    12  type secretManager interface {
    13  	NewWithOptions(context.Context, string, ...option.ClientOption) (secretManagerClient, error)
    14  }
    15  
    16  type secretManagerClient interface {
    17  	GetSecretVersionValue(ctx context.Context, secretID string, version string) ([]byte, error)
    18  	AddSecret(ctx context.Context, secretID string, secretValue []byte, labels map[string]string, forceLabelsUpdate bool, expireAt *time.Time, versionAlias string) error
    19  }
    20  
    21  type gcpSecretManager struct{}
    22  
    23  func (sm *gcpSecretManager) NewWithOptions(ctx context.Context, projectID string, opts ...option.ClientOption) (secretManagerClient, error) {
    24  	return secretmanager.NewWithOptions(ctx, projectID, opts...)
    25  }
    26  

View as plain text