Documentation ¶
Index ¶
- Constants
- func AgentInfoObj() *api.AgentInfo
- func AssertAgentToken(t *testing.T, r *http.Request, agentToken api.AgentToken)
- func AssertCommonRequestParams(t *testing.T, r *http.Request, traceId trace.TraceID)
- func AssertGetJsonRequest(t *testing.T, r *http.Request)
- func AssertGetJsonRequestIsCorrect(t *testing.T, r *http.Request, traceId trace.TraceID)
- func AssertGetRequestIsCorrect(t *testing.T, r *http.Request, traceId trace.TraceID)
- func AssertInvalid(t *testing.T, tests []InvalidTestcase)
- func AssertJWTSignature(t *testing.T, r *http.Request)
- func AssertRequestAccept(t *testing.T, r *http.Request, accept string)
- func AssertRequestAcceptJson(t *testing.T, r *http.Request)
- func AssertRequestContentTypeJson(t *testing.T, r *http.Request)
- func AssertRequestMethod(t *testing.T, r *http.Request, method string)
- func AssertRequestUserAgent(t *testing.T, r *http.Request, userAgent string)
- func AssertValid(t *testing.T, tests []ValidTestcase)
- func CtxWithSpanContext(t *testing.T) (context.Context, trace.TraceID)
- func GenerateCACert(t *testing.T) (string, string, *x509.Certificate, crypto.PrivateKey)
- func GenerateCert(t *testing.T, name string, caCert *x509.Certificate, caKey crypto.PrivateKey) (string, string)
- func InjectSpanContext(t *testing.T, ctx context.Context) (context.Context, trace.TraceID)
- func NewPollConfig(interval time.Duration) retry.PollConfigFactory
- func RecvMsg(value interface{}) func(interface{})
- func RespondWithJSON(t *testing.T, w http.ResponseWriter, response interface{})
- func SetValue(target, value interface{})
- type InvalidTestcase
- type ValidTestcase
- type Validatable
Constants ¶
View Source
const ( KasUserAgent = "kas/v0.1-blabla/asdwd" AgentkToken api.AgentToken = "123123" AuthSecretKey = "blablabla" AgentId int64 = 123 ProjectId int64 = 321 )
Variables ¶
This section is empty.
Functions ¶
func AgentInfoObj ¶
func AssertAgentToken ¶
func AssertInvalid ¶
func AssertInvalid(t *testing.T, tests []InvalidTestcase)
func AssertRequestUserAgent ¶
func AssertValid ¶
func AssertValid(t *testing.T, tests []ValidTestcase)
func CtxWithSpanContext ¶ added in v15.4.0
func GenerateCACert ¶ added in v15.2.0
func GenerateCACert(t *testing.T) (string, string, *x509.Certificate, crypto.PrivateKey)
func GenerateCert ¶ added in v15.2.0
func GenerateCert(t *testing.T, name string, caCert *x509.Certificate, caKey crypto.PrivateKey) (string, string)
func InjectSpanContext ¶ added in v15.4.0
func NewPollConfig ¶
func NewPollConfig(interval time.Duration) retry.PollConfigFactory
func RespondWithJSON ¶
func RespondWithJSON(t *testing.T, w http.ResponseWriter, response interface{})
RespondWithJSON marshals response into JSON and writes it into w.
Types ¶
type InvalidTestcase ¶
type InvalidTestcase struct { ErrString string Invalid Validatable }
type ValidTestcase ¶
type ValidTestcase struct { Name string Valid Validatable }
type Validatable ¶
type Validatable interface {
ValidateAll() error
}
Click to show internal directories.
Click to hide internal directories.