forked from cloudevents/sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alias.go
114 lines (81 loc) · 3.12 KB
/
alias.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package cloudevents
// Package cloudevents alias' common functions and types to improve discoverability and reduce
// the number of imports for simple HTTP clients.
import (
"github.com/cloudevents/sdk-go/pkg/cloudevents"
"github.com/cloudevents/sdk-go/pkg/cloudevents/client"
"github.com/cloudevents/sdk-go/pkg/cloudevents/context"
"github.com/cloudevents/sdk-go/pkg/cloudevents/transport/http"
"github.com/cloudevents/sdk-go/pkg/cloudevents/types"
)
// Client
type ClientOption client.Option
type Client = client.Client
// Event
type Event = cloudevents.Event
type EventResponse = cloudevents.EventResponse
// Context
type EventContext = cloudevents.EventContext
type EventContextV01 = cloudevents.EventContextV01
type EventContextV02 = cloudevents.EventContextV02
type EventContextV03 = cloudevents.EventContextV03
// Custom Types
type Timestamp = types.Timestamp
type URLRef = types.URLRef
// HTTP Transport
type HTTPOption http.Option
type HTTPTransport = http.Transport
type HTTPTransportContext = http.TransportContext
type HTTPTransportResponseContext = http.TransportResponseContext
type HTTPEncoding = http.Encoding
var (
// ContentType Helpers
StringOfApplicationJSON = cloudevents.StringOfApplicationJSON
StringOfApplicationXML = cloudevents.StringOfApplicationXML
StringOfApplicationCloudEventsJSON = cloudevents.StringOfApplicationCloudEventsJSON
StringOfApplicationCloudEventsBatchJSON = cloudevents.StringOfApplicationCloudEventsBatchJSON
StringOfBase64 = cloudevents.StringOfBase64
Base64 = cloudevents.Base64
// Client Creation
NewClient = client.New
NewDefaultClient = client.NewDefault
// Client Options
WithEventDefaulter = client.WithEventDefaulter
WithUUIDs = client.WithUUIDs
WithTimeNow = client.WithTimeNow
// Event Creation
NewEvent = cloudevents.New
VersionV01 = cloudevents.CloudEventsVersionV01
VersionV02 = cloudevents.CloudEventsVersionV02
VersionV03 = cloudevents.CloudEventsVersionV03
// Context
ContextWithTarget = context.WithTarget
TargetFromContext = context.TargetFrom
// Custom Types
ParseTimestamp = types.ParseTimestamp
ParseURLRef = types.ParseURLRef
// HTTP Transport
NewHTTPTransport = http.New
// HTTP Transport Options
WithTarget = http.WithTarget
WithMethod = http.WithMethod
WitHHeader = http.WithHeader
WithShutdownTimeout = http.WithShutdownTimeout
WithEncoding = http.WithEncoding
WithBinaryEncoding = http.WithBinaryEncoding
WithStructuredEncoding = http.WithStructuredEncoding
WithPort = http.WithPort
WithPath = http.WithPath
WithMiddleware = http.WithMiddleware
// HTTP Context
HTTPTransportContextFrom = http.TransportContextFrom
ContextWithHeader = http.ContextWithHeader
// HTTP Transport Encodings
HTTPBinaryV01 = http.BinaryV01
HTTPStructuredV01 = http.StructuredV01
HTTPBinaryV02 = http.BinaryV02
HTTPStructuredV02 = http.StructuredV02
HTTPBinaryV03 = http.BinaryV03
HTTPStructuredV03 = http.StructuredV03
HTTPBatchedV03 = http.BatchedV03
)