/
hello.go
70 lines (58 loc) · 1.56 KB
/
hello.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
68
69
70
package hello
import (
"context"
"database/sql"
"github.com/QuangTung97/otelwrap/internal/generate/hello/embed"
otelgo "github.com/QuangTung97/otelwrap/internal/generate/hello/otel"
otelgosdk "github.com/QuangTung97/otelwrap/internal/generate/hello/otel/sdk"
"time"
)
// User ...
type User struct {
ID int64
Name string
CreatedAt time.Time
IsValid sql.NullBool
}
// Timer ...
type Timer interface {
StartTimer(ctx context.Context, d int32)
}
// Processor ...
type Processor interface {
Timer
embed.Scanner
embed.Parser
DoA(ctx context.Context, n int) error
Handle(ctx context.Context, u *User) error
Get(ctx context.Context, id int64, content otelgosdk.Content) (otelgo.Person, error)
NoName(context.Context, int)
ManyParams(ctx context.Context, params ...string)
UseArray(ctx context.Context, contents []*otelgosdk.Content) (User, error)
UseMap(ctx context.Context, m map[otelgosdk.Content]otelgosdk.Content) map[User]User
}
// Simple ...
type Simple interface {
embed.Scanner
Handle(ctx context.Context, u *User) error
Variadic(ctx context.Context, names ...string)
}
// SimpleAlias ...
type SimpleAlias = Simple
// InterfaceWithUnderscore ...
type InterfaceWithUnderscore interface {
GetName(ctx context.Context, _ string, _ int) (_ int32, _ error)
}
// Handler ...
type Handler interface {
Process(ctx context.Context, n int) error
}
// Null ...
type Null[T any] struct {
Valid bool
Data T
}
// GenericHandler ...
type GenericHandler interface {
GetNull(ctx context.Context, info Null[otelgo.AnotherInfo]) (Null[otelgo.Person], error)
}