Documentation ¶
Index ¶
- func GetConfig(deployment string, config any) error
- func NewSafecilitySql(config MySQLConfig) (*sql.DB, error)
- type Deployment
- type MySQLConfig
- type RedisConfig
- type Secret
- type Secrets
- func (s *Secrets) AddSecretVersion(secretName string, newPayload []byte) (*secretmanagerpb.SecretVersion, error)
- func (s *Secrets) Close() error
- func (s *Secrets) GetSecret(secret Secret) ([]byte, error)
- func (s *Secrets) SetSecret(secretID string, payload []byte) (*secretmanagerpb.Secret, error)
- func (s *Secrets) UpdateSecret(secret Secret, labels map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
GetConfig creates a config for the specified deployment from a local file of form "***-config.json" the json file is decoded into the supplied struct (each service will provide its own config struct)
func NewSafecilitySql ¶
func NewSafecilitySql(config MySQLConfig) (*sql.DB, error)
NewSafecilitySql creates a new MySQL server.
Types ¶
type Deployment ¶
type Deployment string
const ( LocalTest Deployment = "local-test" Local Deployment = "local" Test Deployment = "test" Staging Deployment = "staging" Production Deployment = "prod" )
type MySQLConfig ¶
type RedisConfig ¶
type RedisConfig struct { Host string `json:"host"` Port int `json:"port"` Secret *Secret `json:"secret"` Key []byte `json:"-"` }
func (*RedisConfig) Address ¶
func (r *RedisConfig) Address() string
func (*RedisConfig) NewClient ¶
func (r *RedisConfig) NewClient() (*redis.Client, error)
type Secrets ¶
type Secrets struct {
// contains filtered or unexported fields
}
func GetNewSecrets ¶
func GetNewSecrets(projectID string, client *secretmanager.Client) *Secrets
GetNewSecrets - fix all the weird things in google's api
func (*Secrets) AddSecretVersion ¶
func (s *Secrets) AddSecretVersion(secretName string, newPayload []byte) (*secretmanagerpb.SecretVersion, error)
func (*Secrets) GetSecret ¶
GetSecret retrieve a secret with the given version name. The version name must comply with naming convention - auto is 1, 2 etc
Click to show internal directories.
Click to hide internal directories.