70 lines
977 B
Go
70 lines
977 B
Go
package goapi
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
//
|
|
/*@API*/
|
|
type ARequestStruct struct {
|
|
A *string `json:"SUPERCALIFRAGILISPEALIDOUX"`
|
|
B int64 `json:"bcd"`
|
|
C time.Time
|
|
D *string
|
|
}
|
|
|
|
/*@API*/
|
|
type AResponseStruct struct {
|
|
A string
|
|
B int64
|
|
C time.Time
|
|
D *string
|
|
}
|
|
|
|
/*@API*/
|
|
type AStr struct {
|
|
Country string
|
|
City string
|
|
HouseNumber int64
|
|
IsCondo bool
|
|
SomeWeirdTest string `json:"SUPERCALIFRAGILISPEALIDOUX"`
|
|
}
|
|
|
|
/*@API*/
|
|
type AStr2 struct {
|
|
Firstname string `json:"firstname"`
|
|
Lastname string `json:"lastname"`
|
|
Products []string
|
|
Addresses map[string]AStr
|
|
}
|
|
|
|
/*@API*/
|
|
type Noop struct{}
|
|
|
|
/*
|
|
@API
|
|
@PATH: /someapi
|
|
@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
|
|
*/
|
|
func SomeAPI3(ctx context.Context, a *AStr) ([]*AStr, error) {
|
|
return nil, nil
|
|
}
|