model

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyAuthenticator

type APIKeyAuthenticator struct {
	Key   string         `expr_enabled:"true"`
	Value string         `expr_enabled:"true"`
	In    APIKeyPosition `expr_enabled:"true"`
}

func (APIKeyAuthenticator) AuthenticateGRPC

func (a APIKeyAuthenticator) AuthenticateGRPC()

func (APIKeyAuthenticator) AuthenticateHTTP

func (a APIKeyAuthenticator) AuthenticateHTTP(req *http.Request)

type APIKeyPosition

type APIKeyPosition string
const (
	APIKeyPositionHeader APIKeyPosition = "header"
	APIKeyPositionQuery  APIKeyPosition = "query"
)

type BasicAuthenticator

type BasicAuthenticator struct {
	Username string `expr_enabled:"true"`
	Password string `expr_enabled:"true"`
}

func (BasicAuthenticator) AuthenticateGRPC

func (a BasicAuthenticator) AuthenticateGRPC()

func (BasicAuthenticator) AuthenticateHTTP

func (a BasicAuthenticator) AuthenticateHTTP(req *http.Request)

type BearerAuthenticator

type BearerAuthenticator struct {
	Bearer string `expr_enabled:"true"`
}

func (BearerAuthenticator) AuthenticateGRPC

func (a BearerAuthenticator) AuthenticateGRPC()

func (BearerAuthenticator) AuthenticateHTTP

func (a BearerAuthenticator) AuthenticateHTTP(req *http.Request)

type ConnectionResult

type ConnectionResult struct {
	PortCheck      ConnectionTestStep
	Connectivity   ConnectionTestStep
	Authentication ConnectionTestStep
	FetchTraces    ConnectionTestStep
}

func (ConnectionResult) HasSucceed

func (c ConnectionResult) HasSucceed() bool

type ConnectionTestStep

type ConnectionTestStep struct {
	Passed  bool
	Status  Status
	Message string
	Error   error
}

func (*ConnectionTestStep) HasSucceed

func (r *ConnectionTestStep) HasSucceed() bool

func (*ConnectionTestStep) IsSet

func (r *ConnectionTestStep) IsSet() bool

func (*ConnectionTestStep) UnmarshalJSON

func (s *ConnectionTestStep) UnmarshalJSON(bytes []byte) error

type GRPCHeader

type GRPCHeader struct {
	Key   string `expr_enabled:"true"`
	Value string `expr_enabled:"true"`
}

type GRPCRequest

type GRPCRequest struct {
	ProtobufFile string `expr_enabled:"true"`
	Address      string `expr_enabled:"true"`
	Service      string `expr_enabled:"true"`
	Method       string `expr_enabled:"true"`
	Request      string `expr_enabled:"true"`
	Metadata     []GRPCHeader
	Auth         *HTTPAuthenticator
}

func (GRPCRequest) Authenticate

func (a GRPCRequest) Authenticate()

func (GRPCRequest) Headers

func (a GRPCRequest) Headers() []string

func (GRPCRequest) MD

func (a GRPCRequest) MD() *metadata.MD

type GRPCResponse

type GRPCResponse struct {
	Status     string
	StatusCode int
	Metadata   []GRPCHeader
	Body       string
}

type HTTPAuthenticator

type HTTPAuthenticator struct {
	Type   string `expr_enabled:"true"`
	APIKey APIKeyAuthenticator
	Basic  BasicAuthenticator
	Bearer BearerAuthenticator
}

func (HTTPAuthenticator) AuthenticateGRPC

func (a HTTPAuthenticator) AuthenticateGRPC()

func (HTTPAuthenticator) AuthenticateHTTP

func (a HTTPAuthenticator) AuthenticateHTTP(req *http.Request)

func (HTTPAuthenticator) Map

func (a HTTPAuthenticator) Map(mapFn func(current string) (string, error)) (HTTPAuthenticator, error)

type HTTPHeader

type HTTPHeader struct {
	Key   string `expr_enabled:"true"`
	Value string `expr_enabled:"true"`
}

type HTTPMethod

type HTTPMethod string
var (
	HTTPMethodGET      HTTPMethod = "GET"
	HTTPMethodPUT      HTTPMethod = "PUT"
	HTTPMethodPOST     HTTPMethod = "POST"
	HTTPMethodPATCH    HTTPMethod = "PATCH"
	HTTPMethodDELETE   HTTPMethod = "DELETE"
	HTTPMethodCOPY     HTTPMethod = "COPY"
	HTTPMethodHEAD     HTTPMethod = "HEAD"
	HTTPMethodOPTIONS  HTTPMethod = "OPTIONS"
	HTTPMethodLINK     HTTPMethod = "LINK"
	HTTPMethodUNLINK   HTTPMethod = "UNLINK"
	HTTPMethodPURGE    HTTPMethod = "PURGE"
	HTTPMethodLOCK     HTTPMethod = "LOCK"
	HTTPMethodUNLOCK   HTTPMethod = "UNLOCK"
	HTTPMethodPROPFIND HTTPMethod = "PROPFIND"
	HTTPMethodVIEW     HTTPMethod = "VIEW"
)

type HTTPRequest

type HTTPRequest struct {
	Method          HTTPMethod         `expr_enabled:"true" json:"method,omitempty"`
	URL             string             `expr_enabled:"true" json:"url"`
	Body            string             `expr_enabled:"true" json:"body,omitempty"`
	Headers         []HTTPHeader       `json:"headers,omitempty"`
	Auth            *HTTPAuthenticator `json:"auth,omitempty"`
	SSLVerification bool               `json:"sslVerification,omitempty"`
}

func (HTTPRequest) Authenticate

func (a HTTPRequest) Authenticate(req *http.Request)

type HTTPResponse

type HTTPResponse struct {
	Status     string
	StatusCode int
	Headers    []HTTPHeader
	Body       string
}

type List

type List[T any] struct {
	Items      []T
	TotalCount int
}

type LogLevel

type LogLevel string
var (
	LogLevelWarn  LogLevel = "warning"
	LogLevelError LogLevel = "error"
)

type OutputInfo

type OutputInfo struct {
	LogLevel   LogLevel
	Message    string
	OutputName string
}

type PeriodicPollingConfig

type PeriodicPollingConfig struct {
	NumberSpans      int
	NumberIterations int
}

type PollingInfo

type PollingInfo struct {
	Type       PollingType
	IsComplete bool
	Periodic   *PeriodicPollingConfig
}

type PollingType

type PollingType string
var (
	PollingTypePeriodic PollingType = "periodic"
)

type Protocol

type Protocol string
var (
	ProtocolHTTP Protocol = "http"
	ProtocolGRPC Protocol = "grpc"
)

type Repository

type Repository interface {
	TestRunEventRepository

	ServerID() (id string, isNew bool, _ error)
	Close() error
	Drop() error
}

type Status

type Status string
var (
	StatusPassed  Status = "passed"
	StatusWarning Status = "warning"
	StatusFailed  Status = "failed"
)

type TestRunEvent

type TestRunEvent struct {
	ID                  int64
	Type                string
	Stage               TestRunEventStage
	Title               string
	Description         string
	CreatedAt           time.Time
	TestID              id.ID
	RunID               int
	DataStoreConnection ConnectionResult
	Polling             PollingInfo
	Outputs             []OutputInfo
}

func (TestRunEvent) ResourceID

func (e TestRunEvent) ResourceID() string

type TestRunEventRepository

type TestRunEventRepository interface {
	CreateTestRunEvent(context.Context, TestRunEvent) error
	GetTestRunEvents(context.Context, id.ID, int) ([]TestRunEvent, error)
}

type TestRunEventStage

type TestRunEventStage string
var (
	StageTrigger TestRunEventStage = "trigger"
	StageTrace   TestRunEventStage = "trace"
	StageTest    TestRunEventStage = "test"
)

type TestRunEventType

type TestRunEventType string

type TriggerType

type TriggerType string
const TriggerTypeGRPC TriggerType = "grpc"
const TriggerTypeHTTP TriggerType = "http"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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