agentapi

package
v0.0.0-...-8f0a696 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UI_ApplyProToken_FullMethodName        = "/agentapi.UI/ApplyProToken"
	UI_ApplyLandscapeConfig_FullMethodName = "/agentapi.UI/ApplyLandscapeConfig"
	UI_Ping_FullMethodName                 = "/agentapi.UI/Ping"
	UI_GetConfigSources_FullMethodName     = "/agentapi.UI/GetConfigSources"
	UI_NotifyPurchase_FullMethodName       = "/agentapi.UI/NotifyPurchase"
)
View Source
const (
	WSLInstance_Connected_FullMethodName               = "/agentapi.WSLInstance/Connected"
	WSLInstance_ProAttachmentCommands_FullMethodName   = "/agentapi.WSLInstance/ProAttachmentCommands"
	WSLInstance_LandscapeConfigCommands_FullMethodName = "/agentapi.WSLInstance/LandscapeConfigCommands"
)

Variables

View Source
var File_agentapi_proto protoreflect.FileDescriptor
View Source
var UI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agentapi.UI",
	HandlerType: (*UIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ApplyProToken",
			Handler:    _UI_ApplyProToken_Handler,
		},
		{
			MethodName: "ApplyLandscapeConfig",
			Handler:    _UI_ApplyLandscapeConfig_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _UI_Ping_Handler,
		},
		{
			MethodName: "GetConfigSources",
			Handler:    _UI_GetConfigSources_Handler,
		},
		{
			MethodName: "NotifyPurchase",
			Handler:    _UI_NotifyPurchase_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agentapi.proto",
}

UI_ServiceDesc is the grpc.ServiceDesc for UI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var WSLInstance_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agentapi.WSLInstance",
	HandlerType: (*WSLInstanceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connected",
			Handler:       _WSLInstance_Connected_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "ProAttachmentCommands",
			Handler:       _WSLInstance_ProAttachmentCommands_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "LandscapeConfigCommands",
			Handler:       _WSLInstance_LandscapeConfigCommands_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "agentapi.proto",
}

WSLInstance_ServiceDesc is the grpc.ServiceDesc for WSLInstance service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterUIServer

func RegisterUIServer(s grpc.ServiceRegistrar, srv UIServer)

func RegisterWSLInstanceServer

func RegisterWSLInstanceServer(s grpc.ServiceRegistrar, srv WSLInstanceServer)

Types

type ConfigSources

type ConfigSources struct {
	ProSubscription *SubscriptionInfo `protobuf:"bytes,1,opt,name=proSubscription,proto3" json:"proSubscription,omitempty"`
	LandscapeSource *LandscapeSource  `protobuf:"bytes,2,opt,name=landscapeSource,proto3" json:"landscapeSource,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigSources) Descriptor deprecated

func (*ConfigSources) Descriptor() ([]byte, []int)

Deprecated: Use ConfigSources.ProtoReflect.Descriptor instead.

func (*ConfigSources) GetLandscapeSource

func (x *ConfigSources) GetLandscapeSource() *LandscapeSource

func (*ConfigSources) GetProSubscription

func (x *ConfigSources) GetProSubscription() *SubscriptionInfo

func (*ConfigSources) ProtoMessage

func (*ConfigSources) ProtoMessage()

func (*ConfigSources) ProtoReflect

func (x *ConfigSources) ProtoReflect() protoreflect.Message

func (*ConfigSources) Reset

func (x *ConfigSources) Reset()

func (*ConfigSources) String

func (x *ConfigSources) String() string

type DistroInfo

type DistroInfo struct {
	WslName     string `protobuf:"bytes,1,opt,name=wsl_name,json=wslName,proto3" json:"wsl_name,omitempty"`
	Id          string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	VersionId   string `protobuf:"bytes,3,opt,name=version_id,json=versionId,proto3" json:"version_id,omitempty"`
	PrettyName  string `protobuf:"bytes,4,opt,name=pretty_name,json=prettyName,proto3" json:"pretty_name,omitempty"`
	ProAttached bool   `protobuf:"varint,5,opt,name=pro_attached,json=proAttached,proto3" json:"pro_attached,omitempty"`
	Hostname    string `protobuf:"bytes,6,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// contains filtered or unexported fields
}

func (*DistroInfo) Descriptor deprecated

func (*DistroInfo) Descriptor() ([]byte, []int)

Deprecated: Use DistroInfo.ProtoReflect.Descriptor instead.

func (*DistroInfo) GetHostname

func (x *DistroInfo) GetHostname() string

func (*DistroInfo) GetId

func (x *DistroInfo) GetId() string

func (*DistroInfo) GetPrettyName

func (x *DistroInfo) GetPrettyName() string

func (*DistroInfo) GetProAttached

func (x *DistroInfo) GetProAttached() bool

func (*DistroInfo) GetVersionId

func (x *DistroInfo) GetVersionId() string

func (*DistroInfo) GetWslName

func (x *DistroInfo) GetWslName() string

func (*DistroInfo) ProtoMessage

func (*DistroInfo) ProtoMessage()

func (*DistroInfo) ProtoReflect

func (x *DistroInfo) ProtoReflect() protoreflect.Message

func (*DistroInfo) Reset

func (x *DistroInfo) Reset()

func (*DistroInfo) String

func (x *DistroInfo) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type LandscapeConfig

type LandscapeConfig struct {
	Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*LandscapeConfig) Descriptor deprecated

func (*LandscapeConfig) Descriptor() ([]byte, []int)

Deprecated: Use LandscapeConfig.ProtoReflect.Descriptor instead.

func (*LandscapeConfig) GetConfig

func (x *LandscapeConfig) GetConfig() string

func (*LandscapeConfig) ProtoMessage

func (*LandscapeConfig) ProtoMessage()

func (*LandscapeConfig) ProtoReflect

func (x *LandscapeConfig) ProtoReflect() protoreflect.Message

func (*LandscapeConfig) Reset

func (x *LandscapeConfig) Reset()

func (*LandscapeConfig) String

func (x *LandscapeConfig) String() string

type LandscapeConfigCmd

type LandscapeConfigCmd struct {
	Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*LandscapeConfigCmd) Descriptor deprecated

func (*LandscapeConfigCmd) Descriptor() ([]byte, []int)

Deprecated: Use LandscapeConfigCmd.ProtoReflect.Descriptor instead.

func (*LandscapeConfigCmd) GetConfig

func (x *LandscapeConfigCmd) GetConfig() string

func (*LandscapeConfigCmd) ProtoMessage

func (*LandscapeConfigCmd) ProtoMessage()

func (*LandscapeConfigCmd) ProtoReflect

func (x *LandscapeConfigCmd) ProtoReflect() protoreflect.Message

func (*LandscapeConfigCmd) Reset

func (x *LandscapeConfigCmd) Reset()

func (*LandscapeConfigCmd) String

func (x *LandscapeConfigCmd) String() string

type LandscapeSource

type LandscapeSource struct {

	// Types that are assignable to LandscapeSourceType:
	//
	//	*LandscapeSource_None
	//	*LandscapeSource_User
	//	*LandscapeSource_Organization
	LandscapeSourceType isLandscapeSource_LandscapeSourceType `protobuf_oneof:"landscapeSourceType"`
	// contains filtered or unexported fields
}

func (*LandscapeSource) Descriptor deprecated

func (*LandscapeSource) Descriptor() ([]byte, []int)

Deprecated: Use LandscapeSource.ProtoReflect.Descriptor instead.

func (*LandscapeSource) GetLandscapeSourceType

func (m *LandscapeSource) GetLandscapeSourceType() isLandscapeSource_LandscapeSourceType

func (*LandscapeSource) GetNone

func (x *LandscapeSource) GetNone() *Empty

func (*LandscapeSource) GetOrganization

func (x *LandscapeSource) GetOrganization() *Empty

func (*LandscapeSource) GetUser

func (x *LandscapeSource) GetUser() *Empty

func (*LandscapeSource) ProtoMessage

func (*LandscapeSource) ProtoMessage()

func (*LandscapeSource) ProtoReflect

func (x *LandscapeSource) ProtoReflect() protoreflect.Message

func (*LandscapeSource) Reset

func (x *LandscapeSource) Reset()

func (*LandscapeSource) String

func (x *LandscapeSource) String() string

type LandscapeSource_None

type LandscapeSource_None struct {
	None *Empty `protobuf:"bytes,1,opt,name=none,proto3,oneof"` // There is no active Landscape config data.
}

type LandscapeSource_Organization

type LandscapeSource_Organization struct {
	Organization *Empty `protobuf:"bytes,3,opt,name=organization,proto3,oneof"` // The Landscape config is managedby the sysadmin, set via the registry.
}

type LandscapeSource_User

type LandscapeSource_User struct {
	User *Empty `protobuf:"bytes,2,opt,name=user,proto3,oneof"` // The Landscape config is managed by the user, set via the GUI.
}

type MSG

type MSG struct {

	// Types that are assignable to Data:
	//
	//	*MSG_WslName
	//	*MSG_Result
	Data isMSG_Data `protobuf_oneof:"data"`
	// contains filtered or unexported fields
}

func (*MSG) Descriptor deprecated

func (*MSG) Descriptor() ([]byte, []int)

Deprecated: Use MSG.ProtoReflect.Descriptor instead.

func (*MSG) GetData

func (m *MSG) GetData() isMSG_Data

func (*MSG) GetResult

func (x *MSG) GetResult() string

func (*MSG) GetWslName

func (x *MSG) GetWslName() string

func (*MSG) ProtoMessage

func (*MSG) ProtoMessage()

func (*MSG) ProtoReflect

func (x *MSG) ProtoReflect() protoreflect.Message

func (*MSG) Reset

func (x *MSG) Reset()

func (*MSG) String

func (x *MSG) String() string

type MSG_Result

type MSG_Result struct {
	Result string `protobuf:"bytes,2,opt,name=result,proto3,oneof"` // Used in response to a command
}

type MSG_WslName

type MSG_WslName struct {
	WslName string `protobuf:"bytes,1,opt,name=wsl_name,json=wslName,proto3,oneof"` // Used during handshake to identify the WSL instance.
}

type ProAttachCmd

type ProAttachCmd struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*ProAttachCmd) Descriptor deprecated

func (*ProAttachCmd) Descriptor() ([]byte, []int)

Deprecated: Use ProAttachCmd.ProtoReflect.Descriptor instead.

func (*ProAttachCmd) GetToken

func (x *ProAttachCmd) GetToken() string

func (*ProAttachCmd) ProtoMessage

func (*ProAttachCmd) ProtoMessage()

func (*ProAttachCmd) ProtoReflect

func (x *ProAttachCmd) ProtoReflect() protoreflect.Message

func (*ProAttachCmd) Reset

func (x *ProAttachCmd) Reset()

func (*ProAttachCmd) String

func (x *ProAttachCmd) String() string

type ProAttachInfo

type ProAttachInfo struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*ProAttachInfo) Descriptor deprecated

func (*ProAttachInfo) Descriptor() ([]byte, []int)

Deprecated: Use ProAttachInfo.ProtoReflect.Descriptor instead.

func (*ProAttachInfo) GetToken

func (x *ProAttachInfo) GetToken() string

func (*ProAttachInfo) ProtoMessage

func (*ProAttachInfo) ProtoMessage()

func (*ProAttachInfo) ProtoReflect

func (x *ProAttachInfo) ProtoReflect() protoreflect.Message

func (*ProAttachInfo) Reset

func (x *ProAttachInfo) Reset()

func (*ProAttachInfo) String

func (x *ProAttachInfo) String() string

type SubscriptionInfo

type SubscriptionInfo struct {
	ProductId string `protobuf:"bytes,1,opt,name=productId,proto3" json:"productId,omitempty"` // The ID of the Ubuntu Pro for WSL product on the Microsoft Store.
	// Types that are assignable to SubscriptionType:
	//
	//	*SubscriptionInfo_None
	//	*SubscriptionInfo_User
	//	*SubscriptionInfo_Organization
	//	*SubscriptionInfo_MicrosoftStore
	SubscriptionType isSubscriptionInfo_SubscriptionType `protobuf_oneof:"subscriptionType"`
	// contains filtered or unexported fields
}

func (*SubscriptionInfo) Descriptor deprecated

func (*SubscriptionInfo) Descriptor() ([]byte, []int)

Deprecated: Use SubscriptionInfo.ProtoReflect.Descriptor instead.

func (*SubscriptionInfo) GetMicrosoftStore

func (x *SubscriptionInfo) GetMicrosoftStore() *Empty

func (*SubscriptionInfo) GetNone

func (x *SubscriptionInfo) GetNone() *Empty

func (*SubscriptionInfo) GetOrganization

func (x *SubscriptionInfo) GetOrganization() *Empty

func (*SubscriptionInfo) GetProductId

func (x *SubscriptionInfo) GetProductId() string

func (*SubscriptionInfo) GetSubscriptionType

func (m *SubscriptionInfo) GetSubscriptionType() isSubscriptionInfo_SubscriptionType

func (*SubscriptionInfo) GetUser

func (x *SubscriptionInfo) GetUser() *Empty

func (*SubscriptionInfo) ProtoMessage

func (*SubscriptionInfo) ProtoMessage()

func (*SubscriptionInfo) ProtoReflect

func (x *SubscriptionInfo) ProtoReflect() protoreflect.Message

func (*SubscriptionInfo) Reset

func (x *SubscriptionInfo) Reset()

func (*SubscriptionInfo) String

func (x *SubscriptionInfo) String() string

type SubscriptionInfo_MicrosoftStore

type SubscriptionInfo_MicrosoftStore struct {
	MicrosoftStore *Empty `protobuf:"bytes,5,opt,name=microsoftStore,proto3,oneof"` // The subscription is managed via the Microsoft store.
}

type SubscriptionInfo_None

type SubscriptionInfo_None struct {
	None *Empty `protobuf:"bytes,2,opt,name=none,proto3,oneof"` // There is no active subscription.
}

type SubscriptionInfo_Organization

type SubscriptionInfo_Organization struct {
	Organization *Empty `protobuf:"bytes,4,opt,name=organization,proto3,oneof"` // The subscription is managed by the sysadmin with a pro token from the registry.
}

type SubscriptionInfo_User

type SubscriptionInfo_User struct {
	User *Empty `protobuf:"bytes,3,opt,name=user,proto3,oneof"` // The subscription is managed by the user with a pro token from the GUI or the registry.
}

type UIClient

type UIClient interface {
	ApplyProToken(ctx context.Context, in *ProAttachInfo, opts ...grpc.CallOption) (*SubscriptionInfo, error)
	ApplyLandscapeConfig(ctx context.Context, in *LandscapeConfig, opts ...grpc.CallOption) (*LandscapeSource, error)
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	GetConfigSources(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConfigSources, error)
	NotifyPurchase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SubscriptionInfo, error)
}

UIClient is the client API for UI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewUIClient

func NewUIClient(cc grpc.ClientConnInterface) UIClient

type UIServer

type UIServer interface {
	ApplyProToken(context.Context, *ProAttachInfo) (*SubscriptionInfo, error)
	ApplyLandscapeConfig(context.Context, *LandscapeConfig) (*LandscapeSource, error)
	Ping(context.Context, *Empty) (*Empty, error)
	GetConfigSources(context.Context, *Empty) (*ConfigSources, error)
	NotifyPurchase(context.Context, *Empty) (*SubscriptionInfo, error)
	// contains filtered or unexported methods
}

UIServer is the server API for UI service. All implementations must embed UnimplementedUIServer for forward compatibility.

type UnimplementedUIServer

type UnimplementedUIServer struct{}

UnimplementedUIServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedUIServer) ApplyLandscapeConfig

func (UnimplementedUIServer) ApplyProToken

func (UnimplementedUIServer) GetConfigSources

func (UnimplementedUIServer) NotifyPurchase

func (UnimplementedUIServer) Ping

type UnimplementedWSLInstanceServer

type UnimplementedWSLInstanceServer struct{}

UnimplementedWSLInstanceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedWSLInstanceServer) Connected

func (UnimplementedWSLInstanceServer) LandscapeConfigCommands

func (UnimplementedWSLInstanceServer) ProAttachmentCommands

type UnsafeUIServer

type UnsafeUIServer interface {
	// contains filtered or unexported methods
}

UnsafeUIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UIServer will result in compilation errors.

type UnsafeWSLInstanceServer

type UnsafeWSLInstanceServer interface {
	// contains filtered or unexported methods
}

UnsafeWSLInstanceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WSLInstanceServer will result in compilation errors.

type WSLInstanceClient

type WSLInstanceClient interface {
	Connected(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[DistroInfo, Empty], error)
	// Reverse unary calls
	ProAttachmentCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, ProAttachCmd], error)
	LandscapeConfigCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, LandscapeConfigCmd], error)
}

WSLInstanceClient is the client API for WSLInstance service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type WSLInstanceServer

type WSLInstanceServer interface {
	Connected(grpc.ClientStreamingServer[DistroInfo, Empty]) error
	// Reverse unary calls
	ProAttachmentCommands(grpc.BidiStreamingServer[MSG, ProAttachCmd]) error
	LandscapeConfigCommands(grpc.BidiStreamingServer[MSG, LandscapeConfigCmd]) error
	// contains filtered or unexported methods
}

WSLInstanceServer is the server API for WSLInstance service. All implementations must embed UnimplementedWSLInstanceServer for forward compatibility.

type WSLInstance_ConnectedClient

type WSLInstance_ConnectedClient = grpc.ClientStreamingClient[DistroInfo, Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WSLInstance_ConnectedServer

type WSLInstance_ConnectedServer = grpc.ClientStreamingServer[DistroInfo, Empty]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WSLInstance_LandscapeConfigCommandsClient

type WSLInstance_LandscapeConfigCommandsClient = grpc.BidiStreamingClient[MSG, LandscapeConfigCmd]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WSLInstance_LandscapeConfigCommandsServer

type WSLInstance_LandscapeConfigCommandsServer = grpc.BidiStreamingServer[MSG, LandscapeConfigCmd]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WSLInstance_ProAttachmentCommandsClient

type WSLInstance_ProAttachmentCommandsClient = grpc.BidiStreamingClient[MSG, ProAttachCmd]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type WSLInstance_ProAttachmentCommandsServer

type WSLInstance_ProAttachmentCommandsServer = grpc.BidiStreamingServer[MSG, ProAttachCmd]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL