apigen/test/goapi/test.go

68 lines
1.1 KiB
Go
Raw Normal View History

package goapi
import (
"context"
2021-03-22 02:08:04 +00:00
"crypto"
2021-01-30 09:53:34 +00:00
"time"
)
2021-01-30 09:53:34 +00:00
/*@API*/
type AStr struct {
Country string
City string
HouseNumber int64
IsCondo bool
SomeWeirdTest string `json:"SUPERCALIFRAGILISPEALIDOUX"`
2021-03-22 02:08:04 +00:00
Recursive map[string]AStr
Arrofpstr []string `json:"arrofpstr,omitempty"`
When time.Time
Some crypto.Decrypter
}
/*
@API
2020-11-06 23:16:52 +00:00
@PATH: /someapi
2021-01-30 09:53:34 +00:00
@PERM: ASD
2021-03-22 02:08:04 +00:00
@VERB: POST
2021-01-30 09:53:34 +00:00
*/
2021-11-28 22:08:32 +00:00
func SomeAPI(ctx context.Context, s *AStr) (out *AStr, err error) {
2021-09-07 16:15:32 +00:00
//print("Got:" + s)
//out = time.Now().String() + " - Hey Ya!"
2021-03-22 02:08:04 +00:00
return
2021-01-30 09:53:34 +00:00
}
2021-09-07 16:15:32 +00:00
//
///*
//@API
//@PATH: /someapi
//@PERM: ASD
//@VERB: GET
//*/
//func SomeGET(ctx context.Context, s string) (out string, err error) {
// print("Got:" + s)
// out = time.Now().String() + " - Hey Ya!"
// return
//}
//
///*
//@API
//@PATH: /someapi
//@PERM: ASD
//@VERB: PUT
//*/
//func SomePUT(ctx context.Context, s string) (out string, err error) {
// print("Got:" + s)
// out = time.Now().String() + " - Hey Ya!"
// return
//}
//
///*
//@API
//@PATH: /someapi
//@PERM: ASD
//@VERB: DELETE
//*/
//func SomeAPI2(ctx context.Context, s *crypto.Hash) ([]string, error) {
// return nil, nil
//}