apigen/test/goapi/test.go

70 lines
977 B
Go
Raw Normal View History

package goapi
import (
"context"
2021-01-30 09:53:34 +00:00
"time"
)
2020-12-12 12:21:12 +00:00
//
2021-01-30 09:53:34 +00:00
/*@API*/
type ARequestStruct struct {
A *string `json:"SUPERCALIFRAGILISPEALIDOUX"`
B int64 `json:"bcd"`
C time.Time
D *string
}
/*@API*/
2021-01-30 09:53:34 +00:00
type AResponseStruct struct {
A string
2021-01-30 09:53:34 +00:00
B int64
C time.Time
D *string
}
/*@API*/
type AStr struct {
Country string
City string
HouseNumber int64
IsCondo bool
SomeWeirdTest string `json:"SUPERCALIFRAGILISPEALIDOUX"`
}
2021-01-30 09:53:34 +00:00
/*@API*/
type AStr2 struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Products []string
Addresses map[string]AStr
}
/*@API*/
type Noop struct{}
/*
@API
2020-11-06 23:16:52 +00:00
@PATH: /someapi
2021-01-30 09:53:34 +00:00
@PERM: ASD
@VERB: PUT
*/
func SomeAPI(ctx context.Context, a *Noop) ([]*AStr, error) {
return nil, nil
}
/*
@API
@PATH: /someapi
*/
func SomeAPI2(ctx context.Context, a *AStr2) ([]*AStr, error) {
return nil, nil
}
/*
@API
@PATH: /someapi3
*/
2021-01-30 09:53:34 +00:00
func SomeAPI3(ctx context.Context, a *AStr) ([]*AStr, error) {
return nil, nil
}