Documentation
¶
Index ¶
- Variables
- func AdminClient() *resty.Client
- func AdminTLSClient() *resty.Client
- func ClearEnvironments(envs map[string]string)
- func Env() map[string]string
- func ExecAppCommand(args ...string) (output string, err error)
- func FileCountLine(filename string) (int, error)
- func FileHasLine(filename string, regex string) (bool, error)
- func FileLine(filename string, n int) (string, error)
- func GenerateTraceID() string
- func GetDeafultWorkspace() (*entities.Workspace, error)
- func InitDB(truncated bool, entities *TestEntities) *db.DB
- func InitOtelOutput()
- func LoadConfig(opts LoadConfigOptions) (*config.Config, error)
- func MustStart(envs map[string]string, opts ...Option) *app.Application
- func NewDB(cfg *config.Config) *db.DB
- func NewTestEnv(sets map[string]string) map[string]string
- func PathExist(_path string) bool
- func ProxyClient() *resty.Client
- func ProxyTLSClient() *resty.Client
- func ReplaceLicenser(licenser license.Licenser) func()
- func SecretManangerClient() *secretsmanager.Client
- func SetEnvironments(envs map[string]string)
- func SetEnvs(sets map[string]string) func()
- func Start(envs map[string]string, opts ...Option) (application *app.Application, err error)
- func StartHttpServer(handler http.HandlerFunc, addr string) *http.Server
- func StatusClient() *resty.Client
- func TruncateFile(filename string) error
- func VaultClient() *vault.Client
- func WaitForServer(urlstring string, timeout time.Duration) error
- type LoadConfigOptions
- type MockLicenser
- type Option
- type Options
- type TestEntities
- func (t *TestEntities) AddAttempt(attempt *entities.Attempt)
- func (t *TestEntities) AddAttemptDetail(attemptDetail *entities.AttemptDetail)
- func (t *TestEntities) AddEndpoint(endpoint *entities.Endpoint)
- func (t *TestEntities) AddEvent(event *entities.Event)
- func (t *TestEntities) AddPlugin(plugin *entities.Plugin)
- func (t *TestEntities) AddSource(source *entities.Source)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProxyHttpURL = "http://localhost:9700" ProxyHttpsURL = "https://localhost:9700" AdminHttpURL = "http://localhost:9701" AdminHttpsURL = "https://localhost:9701" StatusHttpURL = "http://localhost:9702" LogFile = test.FilePath("webhookx.log") OtelCollectorTracesFile = test.FilePath("output/otel/traces.json") OtelCollectorMetricsFile = test.FilePath("output/otel/metrics.json") // Environments is default test environments Environments = map[string]string{ "NO_COLOR": "true", "WEBHOOKX_LOG_LEVEL": "debug", "WEBHOOKX_LOG_FORMAT": "text", "WEBHOOKX_LOG_FILE": LogFile, "WEBHOOKX_LOG_COLORED": "false", "WEBHOOKX_ACCESS_LOG_FILE": LogFile, "WEBHOOKX_ACCESS_LOG_COLORED": "false", "WEBHOOKX_WORKER_DELIVERER_ACL_DENY": "", "WEBHOOKX_PROXY_LISTEN": "127.0.0.1:9700", "WEBHOOKX_ADMIN_LISTEN": "127.0.0.1:9701", "WEBHOOKX_STATUS_LISTEN": "127.0.0.1:9702", "WEBHOOKX_DATABASE_DATABASE": "webhookx_test", "WEBHOOKX_DATABASE_MAX_POOL_SIZE": "20", "WEBHOOKX_DATABASE_MAX_LIFETIME": "60", "WEBHOOKX_WORKER_POOL_SIZE": "100", "WEBHOOKX_WORKER_POOL_CONCURRENCY": "10", } )
Functions ¶
func AdminClient ¶
func AdminTLSClient ¶ added in v0.5.0
func ClearEnvironments ¶ added in v1.0.0
func ExecAppCommand ¶ added in v1.0.0
ExecAppCommand executes application command
func FileCountLine ¶ added in v0.3.0
func GenerateTraceID ¶ added in v0.4.0
func GenerateTraceID() string
func GetDeafultWorkspace ¶ added in v0.4.0
func InitOtelOutput ¶ added in v0.4.0
func InitOtelOutput()
func LoadConfig ¶ added in v1.0.0
func LoadConfig(opts LoadConfigOptions) (*config.Config, error)
func MustStart ¶ added in v1.0.0
func MustStart(envs map[string]string, opts ...Option) *app.Application
func NewTestEnv ¶ added in v1.0.0
NewTestEnv returns a map that with default test environment variables set.
func ProxyClient ¶
func ProxyTLSClient ¶ added in v0.5.0
func ReplaceLicenser ¶ added in v1.0.0
func SecretManangerClient ¶ added in v1.0.0
func SecretManangerClient() *secretsmanager.Client
func SetEnvironments ¶ added in v1.0.0
func SetEnvs ¶ added in v1.0.0
SetEnvs sets env variables and returns a function to restore environment variables
func StartHttpServer ¶ added in v1.0.0
func StartHttpServer(handler http.HandlerFunc, addr string) *http.Server
func StatusClient ¶ added in v0.8.0
func TruncateFile ¶
func VaultClient ¶ added in v1.0.0
Types ¶
type LoadConfigOptions ¶ added in v1.0.0
type MockLicenser ¶ added in v1.0.0
type MockLicenser struct{}
func (*MockLicenser) Allow ¶ added in v1.0.0
func (l *MockLicenser) Allow(feature string) bool
func (*MockLicenser) AllowAPI ¶ added in v1.0.0
func (l *MockLicenser) AllowAPI(workspace string, path string, method string) bool
func (*MockLicenser) AllowPlugin ¶ added in v1.0.0
func (l *MockLicenser) AllowPlugin(plugin string) bool
func (*MockLicenser) License ¶ added in v1.0.0
func (l *MockLicenser) License() *apilicense.License
type TestEntities ¶ added in v1.0.0
type TestEntities struct {
Endpoints []*entities.Endpoint
Sources []*entities.Source
Events []*entities.Event
Attempts []*entities.Attempt
AttemptDetails []*entities.AttemptDetail
Plugins []*entities.Plugin
}
func (*TestEntities) AddAttempt ¶ added in v1.0.0
func (t *TestEntities) AddAttempt(attempt *entities.Attempt)
func (*TestEntities) AddAttemptDetail ¶ added in v1.0.0
func (t *TestEntities) AddAttemptDetail(attemptDetail *entities.AttemptDetail)
func (*TestEntities) AddEndpoint ¶ added in v1.0.0
func (t *TestEntities) AddEndpoint(endpoint *entities.Endpoint)
func (*TestEntities) AddEvent ¶ added in v1.0.0
func (t *TestEntities) AddEvent(event *entities.Event)
func (*TestEntities) AddPlugin ¶ added in v1.0.0
func (t *TestEntities) AddPlugin(plugin *entities.Plugin)
func (*TestEntities) AddSource ¶ added in v1.0.0
func (t *TestEntities) AddSource(source *entities.Source)
Click to show internal directories.
Click to hide internal directories.