proto

package
v0.0.1-alpha.12 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Source_Fetch_FullMethodName = "/proto.Source/Fetch"
	Source_Stop_FullMethodName  = "/proto.Source/Stop"
)
View Source
const (
	Exporter_Send_FullMethodName = "/proto.Exporter/Send"
)

Variables

View Source
var Exporter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Exporter",
	HandlerType: (*ExporterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Send",
			Handler:    _Exporter_Send_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/plugin.proto",
}

Exporter_ServiceDesc is the grpc.ServiceDesc for Exporter 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 File_proto_plugin_proto protoreflect.FileDescriptor
View Source
var Source_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Source",
	HandlerType: (*SourceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _Source_Fetch_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _Source_Stop_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/plugin.proto",
}

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

Functions

func ConvertToInstance

func ConvertToInstance(src *InstanceRequest) (*v1.Instance, error)

ConvertToInstance converts a protobugger InstanceRequest struct to a v1.Instance type

func RegisterExporterServer

func RegisterExporterServer(s grpc.ServiceRegistrar, srv ExporterServer)

func RegisterSourceServer

func RegisterSourceServer(s grpc.ServiceRegistrar, srv SourceServer)

Types

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 ExporterClient

type ExporterClient interface {
	Send(ctx context.Context, in *InstanceRequest, opts ...grpc.CallOption) (*Empty, error)
}

ExporterClient is the client API for Exporter 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 NewExporterClient

func NewExporterClient(cc grpc.ClientConnInterface) ExporterClient

type ExporterServer

type ExporterServer interface {
	Send(context.Context, *InstanceRequest) (*Empty, error)
}

ExporterServer is the server API for Exporter service. All implementations should embed UnimplementedExporterServer for forward compatibility

type InstanceRequest

type InstanceRequest struct {
	Id                string             `protobuf:"bytes,11,opt,name=id,proto3" json:"id,omitempty"`
	Provider          string             `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	Service           string             `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	Name              string             `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Region            string             `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"`
	Zone              string             `protobuf:"bytes,5,opt,name=zone,proto3" json:"zone,omitempty"`
	Kind              string             `protobuf:"bytes,6,opt,name=kind,proto3" json:"kind,omitempty"`
	EmbodiedEmissions *ResourceEmissions `protobuf:"bytes,8,opt,name=EmbodiedEmissions,proto3" json:"EmbodiedEmissions,omitempty"`
	Metrics           map[string]*Metric `` /* 155-byte string literal not displayed */
	Labels            map[string]string  `` /* 154-byte string literal not displayed */
	Status            string             `protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func ConvertToPB

func ConvertToPB(src *v1.Instance) (*InstanceRequest, error)

ConvertToPB is a helper function that converts the Instance type to its protobuffer alternative

func (*InstanceRequest) Descriptor deprecated

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

Deprecated: Use InstanceRequest.ProtoReflect.Descriptor instead.

func (*InstanceRequest) GetEmbodiedEmissions

func (x *InstanceRequest) GetEmbodiedEmissions() *ResourceEmissions

func (*InstanceRequest) GetId

func (x *InstanceRequest) GetId() string

func (*InstanceRequest) GetKind

func (x *InstanceRequest) GetKind() string

func (*InstanceRequest) GetLabels

func (x *InstanceRequest) GetLabels() map[string]string

func (*InstanceRequest) GetMetrics

func (x *InstanceRequest) GetMetrics() map[string]*Metric

func (*InstanceRequest) GetName

func (x *InstanceRequest) GetName() string

func (*InstanceRequest) GetProvider

func (x *InstanceRequest) GetProvider() string

func (*InstanceRequest) GetRegion

func (x *InstanceRequest) GetRegion() string

func (*InstanceRequest) GetService

func (x *InstanceRequest) GetService() string

func (*InstanceRequest) GetStatus

func (x *InstanceRequest) GetStatus() string

func (*InstanceRequest) GetZone

func (x *InstanceRequest) GetZone() string

func (*InstanceRequest) ProtoMessage

func (*InstanceRequest) ProtoMessage()

func (*InstanceRequest) ProtoReflect

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

func (*InstanceRequest) Reset

func (x *InstanceRequest) Reset()

func (*InstanceRequest) String

func (x *InstanceRequest) String() string

type ListInstanceResponse

type ListInstanceResponse struct {
	Instances []*InstanceRequest `protobuf:"bytes,1,rep,name=instances,proto3" json:"instances,omitempty"`
	// contains filtered or unexported fields
}

func (*ListInstanceResponse) Descriptor deprecated

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

Deprecated: Use ListInstanceResponse.ProtoReflect.Descriptor instead.

func (*ListInstanceResponse) GetInstances

func (x *ListInstanceResponse) GetInstances() []*InstanceRequest

func (*ListInstanceResponse) ProtoMessage

func (*ListInstanceResponse) ProtoMessage()

func (*ListInstanceResponse) ProtoReflect

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

func (*ListInstanceResponse) Reset

func (x *ListInstanceResponse) Reset()

func (*ListInstanceResponse) String

func (x *ListInstanceResponse) String() string

type Metric

type Metric struct {
	Name         string             `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Usage        float64            `protobuf:"fixed64,2,opt,name=usage,proto3" json:"usage,omitempty"`
	UnitAmount   float64            `protobuf:"fixed64,3,opt,name=unit_amount,json=unitAmount,proto3" json:"unit_amount,omitempty"`
	Emissions    *ResourceEmissions `protobuf:"bytes,4,opt,name=emissions,proto3" json:"emissions,omitempty"`
	Labels       map[string]string  `` /* 153-byte string literal not displayed */
	Unit         string             `protobuf:"bytes,6,opt,name=unit,proto3" json:"unit,omitempty"`
	UpdatedAt    int64              `protobuf:"varint,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	ResourceType string             `protobuf:"bytes,8,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
	Energy       float64            `protobuf:"fixed64,9,opt,name=energy,proto3" json:"energy,omitempty"`
	// contains filtered or unexported fields
}

func (*Metric) Descriptor deprecated

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

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetEmissions

func (x *Metric) GetEmissions() *ResourceEmissions

func (*Metric) GetEnergy

func (x *Metric) GetEnergy() float64

func (*Metric) GetLabels

func (x *Metric) GetLabels() map[string]string

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) GetResourceType

func (x *Metric) GetResourceType() string

func (*Metric) GetUnit

func (x *Metric) GetUnit() string

func (*Metric) GetUnitAmount

func (x *Metric) GetUnitAmount() float64

func (*Metric) GetUpdatedAt

func (x *Metric) GetUpdatedAt() int64

func (*Metric) GetUsage

func (x *Metric) GetUsage() float64

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

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

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

type ResourceEmissions

type ResourceEmissions struct {
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	Unit  string  `protobuf:"bytes,2,opt,name=unit,proto3" json:"unit,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceEmissions) Descriptor deprecated

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

Deprecated: Use ResourceEmissions.ProtoReflect.Descriptor instead.

func (*ResourceEmissions) GetUnit

func (x *ResourceEmissions) GetUnit() string

func (*ResourceEmissions) GetValue

func (x *ResourceEmissions) GetValue() float64

func (*ResourceEmissions) ProtoMessage

func (*ResourceEmissions) ProtoMessage()

func (*ResourceEmissions) ProtoReflect

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

func (*ResourceEmissions) Reset

func (x *ResourceEmissions) Reset()

func (*ResourceEmissions) String

func (x *ResourceEmissions) String() string

type SourceClient

type SourceClient interface {
	Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListInstanceResponse, error)
	Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

SourceClient is the client API for Source 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 NewSourceClient

func NewSourceClient(cc grpc.ClientConnInterface) SourceClient

type SourceServer

type SourceServer interface {
	Fetch(context.Context, *Empty) (*ListInstanceResponse, error)
	Stop(context.Context, *Empty) (*Empty, error)
}

SourceServer is the server API for Source service. All implementations should embed UnimplementedSourceServer for forward compatibility

type UnimplementedExporterServer

type UnimplementedExporterServer struct {
}

UnimplementedExporterServer should be embedded to have forward compatible implementations.

func (UnimplementedExporterServer) Send

type UnimplementedSourceServer

type UnimplementedSourceServer struct {
}

UnimplementedSourceServer should be embedded to have forward compatible implementations.

func (UnimplementedSourceServer) Fetch

func (UnimplementedSourceServer) Stop

type UnsafeExporterServer

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

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

type UnsafeSourceServer

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

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

Jump to

Keyboard shortcuts

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