-
Notifications
You must be signed in to change notification settings - Fork 5
/
client.go
63 lines (55 loc) · 2.44 KB
/
client.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
package client
import (
"context"
compose "github.com/compose-spec/compose-go/v2/types"
defangv1 "github.com/defang-io/defang/src/protos/io/defang/v1"
)
type ServerStream[Res any] interface {
Close() error
Receive() bool
Msg() *Res
Err() error
}
type ETag = string
type ProjectLoader interface {
LoadWithDefaultProjectName(string) (*compose.Project, error)
LoadWithProjectName(string) (*compose.Project, error)
}
type Client interface {
// Promote(google.protobuf.Empty) returns (google.protobuf.Empty);
// Subscribe(context.Context, *v1.SubscribeRequest) (*v1.SubscribeResponse, error)
// Update(context.Context, *v1.Service) (*v1.ServiceInfo, error)
AgreeToS(context.Context) error
BootstrapCommand(context.Context, string) (ETag, error)
BootstrapList(context.Context) error
CheckLoginAndToS(context.Context) error
CreateUploadURL(context.Context, *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
DelegateSubdomainZone(context.Context, *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error)
// Deprecated: Use Deploy or Destroy instead.
Delete(context.Context, *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error)
DeleteConfig(context.Context, *defangv1.Secrets) error
DeleteSubdomainZone(context.Context) error
Deploy(context.Context, *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
Destroy(context.Context) (ETag, error)
GenerateFiles(context.Context, *defangv1.GenerateFilesRequest) (*defangv1.GenerateFilesResponse, error)
Get(context.Context, *defangv1.ServiceID) (*defangv1.ServiceInfo, error)
GetDelegateSubdomainZone(context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)
GetServices(context.Context) (*defangv1.ListServicesResponse, error)
GetVersions(context.Context) (*defangv1.Version, error)
ListConfig(context.Context) (*defangv1.Secrets, error)
Publish(context.Context, *defangv1.PublishRequest) error
PutConfig(context.Context, *defangv1.SecretValue) error
Restart(context.Context, ...string) (ETag, error)
RevokeToken(context.Context) error
ServiceDNS(name string) string
Tail(context.Context, *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
TearDown(context.Context) error
Token(context.Context, *defangv1.TokenRequest) (*defangv1.TokenResponse, error)
Track(string, ...Property) error
WhoAmI(context.Context) (*defangv1.WhoAmIResponse, error)
LoadProject() (*compose.Project, error)
}
type Property struct {
Name string
Value any
}