test

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccidentRequest

type AccidentRequest struct {
}

func (*AccidentRequest) Fail

func (r *AccidentRequest) Fail(ctx *fasthttp.RequestCtx)

func (*AccidentRequest) Fail2

func (r *AccidentRequest) Fail2(ctx *fasthttp.RequestCtx)

func (*AccidentRequest) Occur

func (r *AccidentRequest) Occur(ctx *fasthttp.RequestCtx)

type App

type App struct {
	Host            *Host
	Config          *Config
	ServiceProvider *ServiceProvider

	Component       *MockComponent
	ComponentRunner *MockComponentRunner
}

func (*App) ConfigureLogger

func (app *App) ConfigureLogger(l *log.Logger)

func (*App) ConfigureTextMapPropagator

func (app *App) ConfigureTextMapPropagator()

func (*App) ConfigureTracerProvider

func (app *App) ConfigureTracerProvider()

func (*App) Init

func (app *App) Init()

func (*App) Logger

func (app *App) Logger() *log.Logger

func (*App) OnInit

func (app *App) OnInit()

func (*App) OnInitComplete

func (app *App) OnInitComplete()

func (*App) OnStart

func (app *App) OnStart(ctx context.Context)

func (*App) OnStop

func (app *App) OnStop(ctx context.Context)

func (*App) TextMapPropagator

func (app *App) TextMapPropagator() propagation.TextMapPropagator

func (*App) TracerProvider

func (app *App) TracerProvider() *trace.SeverityTracerProvider

type BlackholeEventLog

type BlackholeEventLog struct {
	// contains filtered or unexported fields
}

func (*BlackholeEventLog) Flush

func (l *BlackholeEventLog) Flush()

func (*BlackholeEventLog) OnError

func (l *BlackholeEventLog) OnError(ctx *fasthttp.RequestCtx, err interface{}, stackTrace []byte)

func (*BlackholeEventLog) OnProcessRequest

func (l *BlackholeEventLog) OnProcessRequest(ctx *fasthttp.RequestCtx)

func (*BlackholeEventLog) OnProcessRequestComplete

func (l *BlackholeEventLog) OnProcessRequestComplete(ctx *fasthttp.RequestCtx, flag response.ResponseFlag)

type BlackholeLoggerService

type BlackholeLoggerService struct {
	Buffer *bytes.Buffer
}

func (*BlackholeLoggerService) ConfigureLogger

func (*BlackholeLoggerService) ConfigureLogger(l *log.Logger)

func (*BlackholeLoggerService) CreateEventLog

type CacheServer

type CacheServer struct {
	Host     string
	Password string
	DB       int
	PoolSize int
}

type Config

type Config struct {
	// fasthttp server
	ListenAddress  string `arg:"address"`
	EnableCompress bool   `arg:"compress"`
	ServerName     string `arg:"hostname"`

	// redis
	RedisHost     string `env:"*REDIS_HOST"       yaml:"redisHost"`
	RedisPassword string `env:"*REDIS_PASSWORD"   yaml:"redisPassword"`
	RedisDB       int    `env:"REDIS_DB"          yaml:"redisDB"`
	RedisPoolSize int    `env:"REDIS_POOL_SIZE"   yaml:"redisPoolSize"`
	Workspace     string `env:"-"                 yaml:"workspace"`

	// jaeger
	JaegerTraceUrl string `yaml:"jaegerTraceUrl"`
	JaegerQueryUrl string `yaml:"jaegerQueryUrl"`
}

type EchoRequest

type EchoRequest struct {
}

func (*EchoRequest) Init

func (r *EchoRequest) Init()

func (*EchoRequest) Send

func (r *EchoRequest) Send(ctx *fasthttp.RequestCtx)

type EventLog

type EventLog struct {
	// contains filtered or unexported fields
}

func (EventLog) Flush

func (l EventLog) Flush()

func (EventLog) OnError

func (l EventLog) OnError(ctx *fasthttp.RequestCtx, err interface{}, stackTrace []byte)

func (EventLog) OnProcessRequest

func (l EventLog) OnProcessRequest(ctx *fasthttp.RequestCtx)

func (EventLog) OnProcessRequestComplete

func (l EventLog) OnProcessRequestComplete(ctx *fasthttp.RequestCtx, flag response.ResponseFlag)

type FasthttpProxyRequest

type FasthttpProxyRequest struct {
	ServiceProvider *ServiceProvider
}

func (*FasthttpProxyRequest) DO

func (*FasthttpProxyRequest) POST

type Host

type Host fasthttp.Host

func (*Host) Init

func (h *Host) Init(conf *Config)

func (*Host) OnError

func (h *Host) OnError(err error) (disposed bool)

type HttpProxyRequest

type HttpProxyRequest struct {
	ServiceProvider *ServiceProvider
}

func (*HttpProxyRequest) DO

func (r *HttpProxyRequest) DO(ctx *fasthttp.RequestCtx)

func (*HttpProxyRequest) POST

func (r *HttpProxyRequest) POST(ctx *fasthttp.RequestCtx)

type JsonRequest

type JsonRequest struct {
}

func (*JsonRequest) Fail

func (r *JsonRequest) Fail(ctx *fasthttp.RequestCtx)

func (*JsonRequest) Init

func (r *JsonRequest) Init()

func (*JsonRequest) Ping

func (r *JsonRequest) Ping(ctx *fasthttp.RequestCtx)

type LoggingService

type LoggingService struct {
	// contains filtered or unexported fields
}

func (*LoggingService) ConfigureLogger

func (s *LoggingService) ConfigureLogger(l *log.Logger)

func (*LoggingService) CreateEventLog

func (s *LoggingService) CreateEventLog(ev fasthttp.EventEvidence) fasthttp.EventLog

type MockComponent

type MockComponent struct {
}

func (*MockComponent) Runner

func (c *MockComponent) Runner() host.Runner

type MockComponentRunner

type MockComponentRunner struct {
	// contains filtered or unexported fields
}

func (*MockComponentRunner) Start

func (c *MockComponentRunner) Start()

func (*MockComponentRunner) Stop

func (c *MockComponentRunner) Stop()

type MultiEventLog

type MultiEventLog struct {
	EventLogs []fasthttp.EventLog
}

func (MultiEventLog) Flush

func (l MultiEventLog) Flush()

Flush implements middleware.EventLog.

func (MultiEventLog) OnError

func (l MultiEventLog) OnError(ctx *fasthttp.RequestCtx, err interface{}, stackTrace []byte)

WriteError implements middleware.EventLog.

func (MultiEventLog) OnProcessRequest

func (l MultiEventLog) OnProcessRequest(ctx *fasthttp.RequestCtx)

WriteRequest implements middleware.EventLog.

func (MultiEventLog) OnProcessRequestComplete

func (l MultiEventLog) OnProcessRequestComplete(ctx *fasthttp.RequestCtx, flag responseutil.ResponseFlag)

WriteResponse implements middleware.EventLog.

type MultiLoggerService

type MultiLoggerService struct {
	LoggingServices []fasthttp.LoggingService
}

func (*MultiLoggerService) ConfigureLogger

func (s *MultiLoggerService) ConfigureLogger(l *log.Logger)

func (*MultiLoggerService) CreateEventLog

type RootRequest

type RootRequest struct {
}

func (*RootRequest) Ping

func (r *RootRequest) Ping(ctx *fasthttp.RequestCtx)

type ServiceProvider

type ServiceProvider struct {
	CacheClient *CacheServer
}

func (*ServiceProvider) Init

func (provider *ServiceProvider) Init(conf *Config, app *App)

func (*ServiceProvider) Logger

func (provider *ServiceProvider) Logger() *log.Logger

func (*ServiceProvider) TextMapPropagator

func (provider *ServiceProvider) TextMapPropagator() propagation.TextMapPropagator

func (*ServiceProvider) TracerProvider

func (provider *ServiceProvider) TracerProvider() *trace.SeverityTracerProvider

type SettingRequest

type SettingRequest struct {
	ServiceProvider *ServiceProvider
	// contains filtered or unexported fields
}

func (*SettingRequest) Init

func (r *SettingRequest) Init()

func (*SettingRequest) Peek

func (r *SettingRequest) Peek(ctx *fasthttp.RequestCtx)

type TextRequest

type TextRequest struct {
}

func (*TextRequest) Fail

func (r *TextRequest) Fail(ctx *fasthttp.RequestCtx)

func (*TextRequest) Init

func (r *TextRequest) Init()

func (*TextRequest) Ping

func (r *TextRequest) Ping(ctx *fasthttp.RequestCtx)

type TracingPingCounter

type TracingPingCounter struct {
	// contains filtered or unexported fields
}

type TracingRequest

type TracingRequest struct {
	// contains filtered or unexported fields
}

func (*TracingRequest) Init

func (r *TracingRequest) Init()

func (*TracingRequest) Ping

func (r *TracingRequest) Ping(ctx *fasthttp.RequestCtx)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL