Documentation ¶
Overview ¶
Package tester implements the codegen.test microservice.
The tester is used to test the code generator's functions.
Index ¶
- Constants
- type Mock
- type Service
- func (svc *Service) DirectoryServer(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) Echo(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) FunctionPathArguments(ctx context.Context, named string, path2 string, suffix string) (joined string, err error)
- func (svc *Service) Hello(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) Init(initializer func(svc *Service)) *Service
- func (svc *Service) LinesIntersection(ctx context.Context, l1 testerapi.XYLine, l2 *testerapi.XYLine) (b bool, err error)
- func (svc *Service) MultiValueHeaders(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) NonStringPathArguments(ctx context.Context, named int, path2 bool, suffix float64) (joined string, err error)
- func (svc *Service) OnDiscoveredSink(ctx context.Context, p testerapi.XYCoord, n int) (q testerapi.XYCoord, m int, err error)
- func (svc *Service) OnShutdown(ctx context.Context) (err error)
- func (svc *Service) OnStartup(ctx context.Context) (err error)
- func (svc *Service) PathArgumentsPriority(ctx context.Context, foo string) (echo string, err error)
- func (svc *Service) PointDistance(ctx context.Context, p1 testerapi.XYCoord, p2 *testerapi.XYCoord) (d float64, err error)
- func (svc *Service) ShiftPoint(ctx context.Context, p *testerapi.XYCoord, x float64, y float64) (shifted *testerapi.XYCoord, err error)
- func (svc *Service) StringCut(ctx context.Context, s string, sep string) (before string, after string, found bool, err error)
- func (svc *Service) SubArrayRange(ctx context.Context, httpRequestBody []int, min int, max int) (httpResponseBody []int, httpStatusCode int, err error)
- func (svc *Service) SumTwoIntegers(ctx context.Context, x int, y int) (sum int, httpStatusCode int, err error)
- func (svc *Service) UnnamedFunctionPathArguments(ctx context.Context, path1 string, path2 string, path3 string) (joined string, err error)
- func (svc *Service) UnnamedWebPathArguments(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) WebPathArguments(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) WhatTimeIsIt(ctx context.Context) (t time.Time, err error)
Constants ¶
const Hostname = "codegen.test"
Hostname is the default hostname of the microservice: codegen.test.
const SourceCodeSHA256 = "273ca0aca779268ac6fd299b47ea209be4e5af06f70ce6cc7df5d8fa6c6d7bdf"
const Timestamp = "2024-07-06T16:56:51.349466Z"
const Version = 104
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock = intermediate.Mock
Mock is a mockable version of the codegen.test microservice, allowing functions, event sinks and web handlers to be mocked.
type Service ¶
type Service struct {
*intermediate.Intermediate // DO NOT REMOVE
}
Service implements the codegen.test microservice.
The tester is used to test the code generator's functions.
func (*Service) DirectoryServer ¶
DirectoryServer tests service resources given a greedy path argument.
func (*Service) FunctionPathArguments ¶
func (svc *Service) FunctionPathArguments(ctx context.Context, named string, path2 string, suffix string) (joined string, err error)
FunctionPathArguments tests path arguments in functions.
func (*Service) Hello ¶
Hello prints hello in the language best matching the request's Accept-Language header.
func (*Service) Init ¶
Init enables a single-statement pattern for initializing the microservice.
svc.Init(func(svc Service) { svc.SetGreeting("Hello") })
func (*Service) LinesIntersection ¶
func (svc *Service) LinesIntersection(ctx context.Context, l1 testerapi.XYLine, l2 *testerapi.XYLine) (b bool, err error)
LinesIntersection tests nested non-primitive types.
func (*Service) MultiValueHeaders ¶
MultiValueHeaders tests a passing in and returning headers with multiple values.
func (*Service) NonStringPathArguments ¶
func (svc *Service) NonStringPathArguments(ctx context.Context, named int, path2 bool, suffix float64) (joined string, err error)
NonStringPathArguments tests path arguments that are not strings.
func (*Service) OnDiscoveredSink ¶
func (svc *Service) OnDiscoveredSink(ctx context.Context, p testerapi.XYCoord, n int) (q testerapi.XYCoord, m int, err error)
OnDiscovered tests listening to events.
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Service) PathArgumentsPriority ¶
PathArgumentsPriority tests the priority of path arguments in functions.
func (*Service) PointDistance ¶
func (svc *Service) PointDistance(ctx context.Context, p1 testerapi.XYCoord, p2 *testerapi.XYCoord) (d float64, err error)
PointDistance tests a function that takes non-primitive input arguments.
func (*Service) ShiftPoint ¶
func (svc *Service) ShiftPoint(ctx context.Context, p *testerapi.XYCoord, x float64, y float64) (shifted *testerapi.XYCoord, err error)
ShiftPoint tests passing pointers of non-primitive types.
func (*Service) StringCut ¶
func (svc *Service) StringCut(ctx context.Context, s string, sep string) (before string, after string, found bool, err error)
StringCut tests a function that takes primitive input arguments and returns primitive values.
func (*Service) SubArrayRange ¶
func (svc *Service) SubArrayRange(ctx context.Context, httpRequestBody []int, min int, max int) (httpResponseBody []int, httpStatusCode int, err error)
SubArrayRange tests sending arguments as the entire request and response bodies. An httpRequestBody argument allows sending other arguments via query or path. An httpResponseBody argument prevents returning additional values, except for the status code.
func (*Service) SumTwoIntegers ¶
func (svc *Service) SumTwoIntegers(ctx context.Context, x int, y int) (sum int, httpStatusCode int, err error)
SumTwoIntegers tests returning a status code from a function.
func (*Service) UnnamedFunctionPathArguments ¶
func (svc *Service) UnnamedFunctionPathArguments(ctx context.Context, path1 string, path2 string, path3 string) (joined string, err error)
UnnamedFunctionPathArguments tests path arguments that are not named.
func (*Service) UnnamedWebPathArguments ¶
UnnamedWebPathArguments tests path arguments that are not named.
func (*Service) WebPathArguments ¶
WebPathArguments tests path arguments in web handlers.
Directories ¶
Path | Synopsis |
---|---|
app
|
|
Package intermediate serves as the foundation of the codegen.test microservice.
|
Package intermediate serves as the foundation of the codegen.test microservice. |
Package testerapi implements the public API of the codegen.test microservice, including clients and data structures.
|
Package testerapi implements the public API of the codegen.test microservice, including clients and data structures. |