Documentation
¶
Index ¶
- Constants
- func CheckConnectString(connStr string) (string, error)
- func GetConnectString(pluginContext *types.PluginContext) (string, error)
- func GetContextAppId(ctx context.Context) types.AppId
- func GetContextRequestId(ctx context.Context) string
- func GetContextUserId(ctx context.Context) string
- func GetContextValue(ctx context.Context, key types.ContextKey) string
- func GetDefaultConfigs() (*types.GlobalConfig, *types.ClientConfig, *types.ServerConfig, error)
- func GetFuncMap() template.FuncMap
- func GetRequestUserId(thread *starlark.Thread) string
- func GetThreadLocalKey(thread *starlark.Thread, key string) string
- func InitDB(connectString string) (*sql.DB, error)
- func KillGroup(process *os.Process) error
- func LoadClientConfig(contents string, config *types.ClientConfig) error
- func LoadGlobalConfig(contents string, config *types.GlobalConfig) error
- func LoadProperties(filename string) (map[string]string, error)
- func LoadServerConfig(contents string, config *types.ServerConfig) error
- func NewClientConfigEmbedded() (*types.ClientConfig, error)
- func NewServerConfigEmbedded() (*types.ServerConfig, error)
- func SQLItePragmas(db *sql.DB) error
- func SetProcessGroup(cmd *exec.Cmd)
- type HttpClient
- type SecretManager
- type Transport
Constants ¶
const ( ApplicationJson = "application/json" ClaceServiceLocation = "clace" )
const (
DB_CONNECTION_CONFIG = "db_connection"
)
const DEFAULT_CONFIG = "clace.default.toml"
const Scheme = "http+unix"
Scheme is the URL scheme used for HTTP over UNIX domain sockets.
Variables ¶
This section is empty.
Functions ¶
func CheckConnectString ¶ added in v0.9.8
func GetConnectString ¶ added in v0.9.8
func GetConnectString(pluginContext *types.PluginContext) (string, error)
func GetContextRequestId ¶ added in v0.10.2
func GetContextUserId ¶ added in v0.9.8
func GetContextValue ¶ added in v0.10.2
func GetContextValue(ctx context.Context, key types.ContextKey) string
func GetDefaultConfigs ¶
func GetDefaultConfigs() (*types.GlobalConfig, *types.ClientConfig, *types.ServerConfig, error)
func GetFuncMap ¶ added in v0.8.1
GetFuncMap returns a template.FuncMap that includes all the sprig functions except for env and expandenv.
func GetRequestUserId ¶ added in v0.9.8
func GetThreadLocalKey ¶ added in v0.10.2
func LoadClientConfig ¶
func LoadClientConfig(contents string, config *types.ClientConfig) error
LoadClientConfig load a ClientConfig from the given contents
func LoadGlobalConfig ¶
func LoadGlobalConfig(contents string, config *types.GlobalConfig) error
LoadGlobalConfig load a GlobalConfig from the given contents
func LoadProperties ¶ added in v0.9.0
func LoadServerConfig ¶
func LoadServerConfig(contents string, config *types.ServerConfig) error
LoadServerConfig loads a ServerConfig from the given contents
func NewClientConfigEmbedded ¶
func NewClientConfigEmbedded() (*types.ClientConfig, error)
NewClientConfigEmbedded reads the embedded toml file and creates a ClientConfig
func NewServerConfigEmbedded ¶
func NewServerConfigEmbedded() (*types.ServerConfig, error)
NewServerConfigEmbedded reads the embedded toml file and creates a ServerConfig
func SQLItePragmas ¶ added in v0.9.8
func SetProcessGroup ¶
SetProcessGroup sets the process group flag for the command
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(serverUri, user, password string, skipCertCheck bool) *HttpClient
NewHttpClient creates a new HttpClient instance
type SecretManager ¶ added in v0.7.2
type SecretManager struct {
// contains filtered or unexported fields
}
SecretManager provides access to the secrets for the system
func NewSecretManager ¶ added in v0.7.2
func NewSecretManager(ctx context.Context, secretConfig map[string]types.SecretConfig, defaultProvider string) (*SecretManager, error)
func (*SecretManager) AppEvalTemplate ¶ added in v0.10.8
func (s *SecretManager) AppEvalTemplate(appSecrets [][]string, defaultProvider, input string) (string, error)
EvalTemplate evaluates the input string and replaces any secret placeholders with the actual secret value
func (*SecretManager) EvalTemplate ¶ added in v0.7.2
func (s *SecretManager) EvalTemplate(input string) (string, error)
EvalTemplate evaluates the input string and replaces any secret placeholders with the actual secret value
type Transport ¶
type Transport struct { // DialTimeout is deprecated. Use context instead. DialTimeout time.Duration // RequestTimeout is deprecated and has no effect. RequestTimeout time.Duration // ResponseHeaderTimeout is deprecated. Use context instead. ResponseHeaderTimeout time.Duration // contains filtered or unexported fields }
Transport is a http.RoundTripper that connects to Unix domain sockets.
func (*Transport) RegisterLocation ¶
RegisterLocation registers an URL location and maps it to the given file system path.
Calling RegisterLocation twice for the same location is a programmer error, and causes a panic.