multi fixtures
This commit is contained in:
+23
-40
@@ -2,26 +2,10 @@ package goapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto"
|
||||
"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
|
||||
@@ -29,41 +13,40 @@ type AStr struct {
|
||||
HouseNumber int64
|
||||
IsCondo bool
|
||||
SomeWeirdTest string `json:"SUPERCALIFRAGILISPEALIDOUX"`
|
||||
Recursive map[string]AStr
|
||||
Arrofpstr []string `json:"arrofpstr,omitempty"`
|
||||
When time.Time
|
||||
Some crypto.Decrypter
|
||||
}
|
||||
|
||||
/*@API*/
|
||||
type AStr2 struct {
|
||||
Firstname string `json:"firstname"`
|
||||
Lastname string `json:"lastname"`
|
||||
Products []string
|
||||
Addresses map[string]AStr
|
||||
/*
|
||||
@API
|
||||
@PATH: /someapi
|
||||
@PERM: ASD
|
||||
@VERB: POST
|
||||
*/
|
||||
func SomeAPI(ctx context.Context, s string) (out string, err error) {
|
||||
print("Got:" + s)
|
||||
out = time.Now().String() + " - Hey Ya!"
|
||||
return
|
||||
}
|
||||
|
||||
/*@API*/
|
||||
type Noop struct{}
|
||||
|
||||
/*
|
||||
@API
|
||||
@PATH: /someapi
|
||||
@PERM: ASD
|
||||
@VERB: PUT
|
||||
*/
|
||||
func SomeAPI(ctx context.Context, a *Noop) ([]*AStr, error) {
|
||||
return nil, nil
|
||||
}
|
||||
//func SomeAPI2(ctx context.Context, s dcsession.Session) ([]string, error) {
|
||||
// return nil, nil
|
||||
//}
|
||||
|
||||
/*
|
||||
@API
|
||||
@PATH: /someapi
|
||||
@PERM: ASD
|
||||
@VERB: PUT
|
||||
*/
|
||||
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
|
||||
}
|
||||
//func SomeAPI3(ctx context.Context, a time.Time) ([]string, error) {
|
||||
// return nil, nil
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user