-
Notifications
You must be signed in to change notification settings - Fork 0
/
component.go
67 lines (52 loc) · 1.04 KB
/
component.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package test
import (
"context"
"fmt"
"github.com/kanengo/akasar"
)
type ID int64
type Reverser interface {
Reverse(context.Context, string, *arg1, ID) (string, ID, res1, error)
ZNoRetryMethod(ctx context.Context) error
}
var _ akasar.NotRetriable = Reverser.ZNoRetryMethod
type Foo struct {
}
type reverser struct {
akasar.Components[Reverser]
foo *Foo
}
type arg1 struct {
akasar.AutoMarshal
Id int64
Name string
Skills []int32
a2 *arg2
}
type arg2 struct {
akasar.AutoMarshal
Age int
}
type res1 struct {
akasar.AutoMarshal
Id int
}
func (r *reverser) ZNoRetryMethod(ctx context.Context) error {
return nil
}
func (*reverser) Reverse(_ context.Context, s string, arg1 *arg1, id ID) (string, ID, res1, error) {
runes := []rune(s)
n := len(runes)
for i := 0; i < n/2; i++ {
runes[i], runes[n-i-1] = runes[n-i-1], runes[i]
}
return string(runes), 0, res1{}, nil
}
type Error struct {
akasar.AutoMarshal
Code int32
Message string
}
func (e *Error) Error() string {
return fmt.Sprintf("%d-%s", e.Code, e.Message)
}