-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployer.go
80 lines (68 loc) · 3.74 KB
/
deployer.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
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package control
import (
"context"
"github.com/TiagoMalhadas/xcweaver/runtime/protos"
)
// DeployerPath is the path used for the deployer control component.
// It points to an internal type in a different package.
const DeployerPath = "github.com/TiagoMalhadas/xcweaver/deployerControl"
// DeployerControl is the interface for the weaver.deployerControl component. It is
// present in its own package so other packages do not need to copy the interface
// definition.
//
// Arguments and results are protobufs to allow deployers to evolve independently
// of application binaries.
type DeployerControl interface {
// LogBatch logs the supplied batch of log entries.
LogBatch(context.Context, *protos.LogEntryBatch) error
// HandleTraceSpans saves the supplied trace spans.
HandleTraceSpans(context.Context, *protos.TraceSpans) error
// ActivateComponent ensures that the provided component is running
// somewhere. A call to ActivateComponent also implicitly signals that a
// weavelet is interested in receiving routing info for the component.
ActivateComponent(context.Context, *protos.ActivateComponentRequest) (*protos.ActivateComponentReply, error)
// GetListenerAddress returns the address the weavelet should listen on for
// a particular listener.
GetListenerAddress(context.Context, *protos.GetListenerAddressRequest) (*protos.GetListenerAddressReply, error)
// ExportListener exports the provided listener. Exporting a listener
// typically, but not always, involves running a proxy that forwards
// traffic to the provided address.
ExportListener(context.Context, *protos.ExportListenerRequest) (*protos.ExportListenerReply, error)
// GetSelfCertificate returns the certificate and the private key the
// weavelet should use for network connection establishment. The weavelet
// will issue this request each time it establishes a connection with
// another weavelet.
// NOTE: This method is only called if mTLS was enabled for the weavelet,
// by passing it a WeaveletArgs with mtls=true.
GetSelfCertificate(context.Context, *protos.GetSelfCertificateRequest) (*protos.GetSelfCertificateReply, error)
// VerifyClientCertificate verifies the certificate chain presented by
// a network client attempting to connect to the weavelet. It returns an
// error if the network connection should not be established with the
// client. Otherwise, it returns the list of weavelet components that the
// client is authorized to invoke methods on.
//
// NOTE: This method is only called if mTLS was enabled for the weavelet,
// by passing it a WeaveletArgs with mtls=true.
VerifyClientCertificate(context.Context, *protos.VerifyClientCertificateRequest) (*protos.VerifyClientCertificateReply, error)
// VerifyServerCertificate verifies the certificate chain presented by
// the server the weavelet is attempting to connect to. It returns an
// error iff the server identity doesn't match the identity of the specified
// component.
//
// NOTE: This method is only called if mTLS was enabled for the weavelet,
// by passing it a WeaveletArgs with mtls=true.
VerifyServerCertificate(context.Context, *protos.VerifyServerCertificateRequest) (*protos.VerifyServerCertificateReply, error)
}