-
Notifications
You must be signed in to change notification settings - Fork 15
/
serverless.go
64 lines (52 loc) · 2.18 KB
/
serverless.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
package ycsdk
import (
"github.com/yandex-cloud/go-sdk/gen/apigateway"
"github.com/yandex-cloud/go-sdk/gen/apigateway/websocket"
"github.com/yandex-cloud/go-sdk/gen/containers"
"github.com/yandex-cloud/go-sdk/gen/eventrouter"
"github.com/yandex-cloud/go-sdk/gen/functions"
"github.com/yandex-cloud/go-sdk/gen/mdbproxy"
"github.com/yandex-cloud/go-sdk/gen/triggers"
"github.com/yandex-cloud/go-sdk/gen/workflows"
)
type Serverless struct {
sdk *SDK
}
const (
FunctionServiceID Endpoint = "serverless-functions"
TriggerServiceID Endpoint = "serverless-triggers"
APIGatewayServiceID Endpoint = "serverless-apigateway"
MDBProxyServiceID Endpoint = "mdbproxy"
ServerlessContainersServiceID Endpoint = "serverless-containers"
APIGatewayWebsocketServiceID Endpoint = "apigateway-connections"
EventrouterServiceID Endpoint = "serverless-eventrouter"
EventrouterEventsServiceID Endpoint = "serverlesseventrouter-events"
WorkflowServiceID Endpoint = "serverless-workflows"
)
func (s *Serverless) Functions() *functions.Function {
return functions.NewFunction(s.sdk.getConn(FunctionServiceID))
}
func (s *Serverless) Triggers() *triggers.Trigger {
return triggers.NewTrigger(s.sdk.getConn(TriggerServiceID))
}
func (s *Serverless) APIGateway() *apigateway.Apigateway {
return apigateway.NewApigateway(s.sdk.getConn(APIGatewayServiceID))
}
func (s *Serverless) MDBProxy() *mdbproxy.Proxy {
return mdbproxy.NewProxy(s.sdk.getConn(MDBProxyServiceID))
}
func (s *Serverless) Containers() *containers.Container {
return containers.NewContainer(s.sdk.getConn(ServerlessContainersServiceID))
}
func (s *Serverless) APIGatewayWebsocket() *websocket.Websocket {
return websocket.NewWebsocket(s.sdk.getConn(APIGatewayWebsocketServiceID))
}
func (s *Serverless) Eventrouter() *eventrouter.Eventrouter {
return eventrouter.NewEventrouter(s.sdk.getConn(EventrouterServiceID))
}
func (s *Serverless) EventrouterEvents() *eventrouter.Eventrouter {
return eventrouter.NewEventrouter(s.sdk.getConn(EventrouterEventsServiceID))
}
func (s *Serverless) Workflow() *workflows.Workflow {
return workflows.NewWorkflow(s.sdk.getConn(WorkflowServiceID))
}