v1

package
v0.0.1-rc11 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthStatus        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStatus          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStatus = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterProviderRPCHandler

func RegisterProviderRPCHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterProviderRPCHandler registers the http handlers for service ProviderRPC to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterProviderRPCHandlerClient

func RegisterProviderRPCHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProviderRPCClient) error

RegisterProviderRPCHandlerClient registers the http handlers for service ProviderRPC to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProviderRPCClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProviderRPCClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProviderRPCClient" to call the correct interceptors.

func RegisterProviderRPCHandlerFromEndpoint

func RegisterProviderRPCHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterProviderRPCHandlerFromEndpoint is same as RegisterProviderRPCHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterProviderRPCHandlerServer

func RegisterProviderRPCHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProviderRPCServer) error

RegisterProviderRPCHandlerServer registers the http handlers for service ProviderRPC to "mux". UnaryRPC :call ProviderRPCServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProviderRPCHandlerFromEndpoint instead.

func RegisterProviderRPCServer

func RegisterProviderRPCServer(s grpc1.Server, srv ProviderRPCServer)

Types

type BidEngineStatus

type BidEngineStatus struct {
	Orders uint32 `protobuf:"varint,1,opt,name=orders,proto3" json:"orders" yaml:"orders"`
}

BidEngineStatus

func (*BidEngineStatus) Descriptor

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

func (*BidEngineStatus) GetOrders

func (m *BidEngineStatus) GetOrders() uint32

func (*BidEngineStatus) Marshal

func (m *BidEngineStatus) Marshal() (dAtA []byte, err error)

func (*BidEngineStatus) MarshalTo

func (m *BidEngineStatus) MarshalTo(dAtA []byte) (int, error)

func (*BidEngineStatus) MarshalToSizedBuffer

func (m *BidEngineStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BidEngineStatus) ProtoMessage

func (*BidEngineStatus) ProtoMessage()

func (*BidEngineStatus) Reset

func (m *BidEngineStatus) Reset()

func (*BidEngineStatus) Size

func (m *BidEngineStatus) Size() (n int)

func (*BidEngineStatus) String

func (m *BidEngineStatus) String() string

func (*BidEngineStatus) Unmarshal

func (m *BidEngineStatus) Unmarshal(dAtA []byte) error

func (*BidEngineStatus) XXX_DiscardUnknown

func (m *BidEngineStatus) XXX_DiscardUnknown()

func (*BidEngineStatus) XXX_Marshal

func (m *BidEngineStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BidEngineStatus) XXX_Merge

func (m *BidEngineStatus) XXX_Merge(src proto.Message)

func (*BidEngineStatus) XXX_Size

func (m *BidEngineStatus) XXX_Size() int

func (*BidEngineStatus) XXX_Unmarshal

func (m *BidEngineStatus) XXX_Unmarshal(b []byte) error

type ClusterStatus

type ClusterStatus struct {
	Leases    Leases    `protobuf:"bytes,1,opt,name=leases,proto3" json:"leases" yaml:"leases"`
	Inventory Inventory `protobuf:"bytes,2,opt,name=inventory,proto3" json:"inventory" yaml:"inventory"`
}

ClusterStatus

func (*ClusterStatus) Descriptor

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

func (*ClusterStatus) GetInventory

func (m *ClusterStatus) GetInventory() Inventory

func (*ClusterStatus) GetLeases

func (m *ClusterStatus) GetLeases() Leases

func (*ClusterStatus) Marshal

func (m *ClusterStatus) Marshal() (dAtA []byte, err error)

func (*ClusterStatus) MarshalTo

func (m *ClusterStatus) MarshalTo(dAtA []byte) (int, error)

func (*ClusterStatus) MarshalToSizedBuffer

func (m *ClusterStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterStatus) ProtoMessage

func (*ClusterStatus) ProtoMessage()

func (*ClusterStatus) Reset

func (m *ClusterStatus) Reset()

func (*ClusterStatus) Size

func (m *ClusterStatus) Size() (n int)

func (*ClusterStatus) String

func (m *ClusterStatus) String() string

func (*ClusterStatus) Unmarshal

func (m *ClusterStatus) Unmarshal(dAtA []byte) error

func (*ClusterStatus) XXX_DiscardUnknown

func (m *ClusterStatus) XXX_DiscardUnknown()

func (*ClusterStatus) XXX_Marshal

func (m *ClusterStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterStatus) XXX_Merge

func (m *ClusterStatus) XXX_Merge(src proto.Message)

func (*ClusterStatus) XXX_Size

func (m *ClusterStatus) XXX_Size() int

func (*ClusterStatus) XXX_Unmarshal

func (m *ClusterStatus) XXX_Unmarshal(b []byte) error

type Inventory

type Inventory struct {
	Cluster      v1.Cluster   `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster" yaml:"cluster"`
	Reservations Reservations `protobuf:"bytes,2,opt,name=reservations,proto3" json:"reservations" yaml:"reservations"`
}

Inventory

func (*Inventory) Descriptor

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

func (*Inventory) GetCluster

func (m *Inventory) GetCluster() v1.Cluster

func (*Inventory) GetReservations

func (m *Inventory) GetReservations() Reservations

func (*Inventory) Marshal

func (m *Inventory) Marshal() (dAtA []byte, err error)

func (*Inventory) MarshalTo

func (m *Inventory) MarshalTo(dAtA []byte) (int, error)

func (*Inventory) MarshalToSizedBuffer

func (m *Inventory) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Inventory) ProtoMessage

func (*Inventory) ProtoMessage()

func (*Inventory) Reset

func (m *Inventory) Reset()

func (*Inventory) Size

func (m *Inventory) Size() (n int)

func (*Inventory) String

func (m *Inventory) String() string

func (*Inventory) Unmarshal

func (m *Inventory) Unmarshal(dAtA []byte) error

func (*Inventory) XXX_DiscardUnknown

func (m *Inventory) XXX_DiscardUnknown()

func (*Inventory) XXX_Marshal

func (m *Inventory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Inventory) XXX_Merge

func (m *Inventory) XXX_Merge(src proto.Message)

func (*Inventory) XXX_Size

func (m *Inventory) XXX_Size() int

func (*Inventory) XXX_Unmarshal

func (m *Inventory) XXX_Unmarshal(b []byte) error

type Leases

type Leases struct {
	Active uint32 `protobuf:"varint,1,opt,name=active,proto3" json:"active" yaml:"active"`
}

Leases

func (*Leases) Descriptor

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

func (*Leases) GetActive

func (m *Leases) GetActive() uint32

func (*Leases) Marshal

func (m *Leases) Marshal() (dAtA []byte, err error)

func (*Leases) MarshalTo

func (m *Leases) MarshalTo(dAtA []byte) (int, error)

func (*Leases) MarshalToSizedBuffer

func (m *Leases) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Leases) ProtoMessage

func (*Leases) ProtoMessage()

func (*Leases) Reset

func (m *Leases) Reset()

func (*Leases) Size

func (m *Leases) Size() (n int)

func (*Leases) String

func (m *Leases) String() string

func (*Leases) Unmarshal

func (m *Leases) Unmarshal(dAtA []byte) error

func (*Leases) XXX_DiscardUnknown

func (m *Leases) XXX_DiscardUnknown()

func (*Leases) XXX_Marshal

func (m *Leases) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Leases) XXX_Merge

func (m *Leases) XXX_Merge(src proto.Message)

func (*Leases) XXX_Size

func (m *Leases) XXX_Size() int

func (*Leases) XXX_Unmarshal

func (m *Leases) XXX_Unmarshal(b []byte) error

type ManifestStatus

type ManifestStatus struct {
	Deployments uint32 `protobuf:"varint,1,opt,name=deployments,proto3" json:"deployments" yaml:"deployments"`
}

ManifestStatus

func (*ManifestStatus) Descriptor

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

func (*ManifestStatus) GetDeployments

func (m *ManifestStatus) GetDeployments() uint32

func (*ManifestStatus) Marshal

func (m *ManifestStatus) Marshal() (dAtA []byte, err error)

func (*ManifestStatus) MarshalTo

func (m *ManifestStatus) MarshalTo(dAtA []byte) (int, error)

func (*ManifestStatus) MarshalToSizedBuffer

func (m *ManifestStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ManifestStatus) ProtoMessage

func (*ManifestStatus) ProtoMessage()

func (*ManifestStatus) Reset

func (m *ManifestStatus) Reset()

func (*ManifestStatus) Size

func (m *ManifestStatus) Size() (n int)

func (*ManifestStatus) String

func (m *ManifestStatus) String() string

func (*ManifestStatus) Unmarshal

func (m *ManifestStatus) Unmarshal(dAtA []byte) error

func (*ManifestStatus) XXX_DiscardUnknown

func (m *ManifestStatus) XXX_DiscardUnknown()

func (*ManifestStatus) XXX_Marshal

func (m *ManifestStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ManifestStatus) XXX_Merge

func (m *ManifestStatus) XXX_Merge(src proto.Message)

func (*ManifestStatus) XXX_Size

func (m *ManifestStatus) XXX_Size() int

func (*ManifestStatus) XXX_Unmarshal

func (m *ManifestStatus) XXX_Unmarshal(b []byte) error

type ProviderRPCClient

type ProviderRPCClient interface {
	// GetStatus defines a method to query provider state
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
	GetStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Status, error)
	// Status defines a method to stream provider state
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
	StreamStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ProviderRPC_StreamStatusClient, error)
}

ProviderRPCClient is the client API for ProviderRPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewProviderRPCClient

func NewProviderRPCClient(cc grpc1.ClientConn) ProviderRPCClient

type ProviderRPCServer

type ProviderRPCServer interface {
	// GetStatus defines a method to query provider state
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
	GetStatus(context.Context, *emptypb.Empty) (*Status, error)
	// Status defines a method to stream provider state
	// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
	// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
	StreamStatus(*emptypb.Empty, ProviderRPC_StreamStatusServer) error
}

ProviderRPCServer is the server API for ProviderRPC service.

type ProviderRPC_StreamStatusClient

type ProviderRPC_StreamStatusClient interface {
	Recv() (*Status, error)
	grpc.ClientStream
}

type ProviderRPC_StreamStatusServer

type ProviderRPC_StreamStatusServer interface {
	Send(*Status) error
	grpc.ServerStream
}

type Reservations

type Reservations struct {
	Pending ReservationsMetric `protobuf:"bytes,1,opt,name=pending,proto3" json:"pending" yaml:"pending"`
	Active  ReservationsMetric `protobuf:"bytes,2,opt,name=active,proto3" json:"active" yaml:"active"`
}

Reservations

func (*Reservations) Descriptor

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

func (*Reservations) GetActive

func (m *Reservations) GetActive() ReservationsMetric

func (*Reservations) GetPending

func (m *Reservations) GetPending() ReservationsMetric

func (*Reservations) Marshal

func (m *Reservations) Marshal() (dAtA []byte, err error)

func (*Reservations) MarshalTo

func (m *Reservations) MarshalTo(dAtA []byte) (int, error)

func (*Reservations) MarshalToSizedBuffer

func (m *Reservations) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Reservations) ProtoMessage

func (*Reservations) ProtoMessage()

func (*Reservations) Reset

func (m *Reservations) Reset()

func (*Reservations) Size

func (m *Reservations) Size() (n int)

func (*Reservations) String

func (m *Reservations) String() string

func (*Reservations) Unmarshal

func (m *Reservations) Unmarshal(dAtA []byte) error

func (*Reservations) XXX_DiscardUnknown

func (m *Reservations) XXX_DiscardUnknown()

func (*Reservations) XXX_Marshal

func (m *Reservations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Reservations) XXX_Merge

func (m *Reservations) XXX_Merge(src proto.Message)

func (*Reservations) XXX_Size

func (m *Reservations) XXX_Size() int

func (*Reservations) XXX_Unmarshal

func (m *Reservations) XXX_Unmarshal(b []byte) error

type ReservationsMetric

type ReservationsMetric struct {
	Count     uint32          `protobuf:"varint,1,opt,name=count,proto3" json:"count" yaml:"count"`
	Resources ResourcesMetric `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources" yaml:"resources"`
}

ReservationsMetric

func (*ReservationsMetric) Descriptor

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

func (*ReservationsMetric) GetCount

func (m *ReservationsMetric) GetCount() uint32

func (*ReservationsMetric) GetResources

func (m *ReservationsMetric) GetResources() ResourcesMetric

func (*ReservationsMetric) Marshal

func (m *ReservationsMetric) Marshal() (dAtA []byte, err error)

func (*ReservationsMetric) MarshalTo

func (m *ReservationsMetric) MarshalTo(dAtA []byte) (int, error)

func (*ReservationsMetric) MarshalToSizedBuffer

func (m *ReservationsMetric) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReservationsMetric) ProtoMessage

func (*ReservationsMetric) ProtoMessage()

func (*ReservationsMetric) Reset

func (m *ReservationsMetric) Reset()

func (*ReservationsMetric) Size

func (m *ReservationsMetric) Size() (n int)

func (*ReservationsMetric) String

func (m *ReservationsMetric) String() string

func (*ReservationsMetric) Unmarshal

func (m *ReservationsMetric) Unmarshal(dAtA []byte) error

func (*ReservationsMetric) XXX_DiscardUnknown

func (m *ReservationsMetric) XXX_DiscardUnknown()

func (*ReservationsMetric) XXX_Marshal

func (m *ReservationsMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReservationsMetric) XXX_Merge

func (m *ReservationsMetric) XXX_Merge(src proto.Message)

func (*ReservationsMetric) XXX_Size

func (m *ReservationsMetric) XXX_Size() int

func (*ReservationsMetric) XXX_Unmarshal

func (m *ReservationsMetric) XXX_Unmarshal(b []byte) error

type ResourcesMetric

type ResourcesMetric struct {
	CPU              *resource.Quantity `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu" yaml:"cpu"`
	Memory           *resource.Quantity `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory" yaml:"memory"`
	GPU              *resource.Quantity `protobuf:"bytes,3,opt,name=gpu,proto3,castrepeated=GPUs" json:"gpu" yaml:"gpu"`
	EphemeralStorage *resource.Quantity `protobuf:"bytes,4,opt,name=ephemeral_storage,json=ephemeralStorage,proto3" json:"ephemeral_storage" yaml:"ephemeral_storage"`
	Storage          Storage            `` /* 177-byte string literal not displayed */
}

ResourceMetrics

func NewResourcesMetric

func NewResourcesMetric() ResourcesMetric

func (*ResourcesMetric) AddResourceUnit

func (inv *ResourcesMetric) AddResourceUnit(res dtypes.ResourceUnit)

func (*ResourcesMetric) AddResourceUnits

func (inv *ResourcesMetric) AddResourceUnits(res dtypes.ResourceUnits)

func (*ResourcesMetric) AddResources

func (inv *ResourcesMetric) AddResources(res rtypes.Resources)

func (*ResourcesMetric) Descriptor

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

func (*ResourcesMetric) GetCPU

func (m *ResourcesMetric) GetCPU() *resource.Quantity

func (*ResourcesMetric) GetEphemeralStorage

func (m *ResourcesMetric) GetEphemeralStorage() *resource.Quantity

func (*ResourcesMetric) GetGPU

func (m *ResourcesMetric) GetGPU() *resource.Quantity

func (*ResourcesMetric) GetMemory

func (m *ResourcesMetric) GetMemory() *resource.Quantity

func (*ResourcesMetric) GetStorage

func (m *ResourcesMetric) GetStorage() Storage

func (*ResourcesMetric) Marshal

func (m *ResourcesMetric) Marshal() (dAtA []byte, err error)

func (*ResourcesMetric) MarshalTo

func (m *ResourcesMetric) MarshalTo(dAtA []byte) (int, error)

func (*ResourcesMetric) MarshalToSizedBuffer

func (m *ResourcesMetric) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ResourcesMetric) ProtoMessage

func (*ResourcesMetric) ProtoMessage()

func (*ResourcesMetric) Reset

func (m *ResourcesMetric) Reset()

func (*ResourcesMetric) Size

func (m *ResourcesMetric) Size() (n int)

func (*ResourcesMetric) String

func (m *ResourcesMetric) String() string

func (*ResourcesMetric) Unmarshal

func (m *ResourcesMetric) Unmarshal(dAtA []byte) error

func (*ResourcesMetric) XXX_DiscardUnknown

func (m *ResourcesMetric) XXX_DiscardUnknown()

func (*ResourcesMetric) XXX_Marshal

func (m *ResourcesMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResourcesMetric) XXX_Merge

func (m *ResourcesMetric) XXX_Merge(src proto.Message)

func (*ResourcesMetric) XXX_Size

func (m *ResourcesMetric) XXX_Size() int

func (*ResourcesMetric) XXX_Unmarshal

func (m *ResourcesMetric) XXX_Unmarshal(b []byte) error

type Status

type Status struct {
	Errors          []string         `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty" yaml:"errors,omitempty"`
	Cluster         *ClusterStatus   `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty" yaml:"cluster,omitempty"`
	BidEngine       *BidEngineStatus `protobuf:"bytes,3,opt,name=bid_engine,json=bidEngine,proto3" json:"bid_engine,omitempty" yaml:"bid_engine,omitempty"`
	Manifest        *ManifestStatus  `protobuf:"bytes,4,opt,name=manifest,proto3" json:"manifest,omitempty" yaml:"manifest,omitempty"`
	PublicHostnames []string         `protobuf:"bytes,5,rep,name=public_hostnames,json=publicHostnames,proto3" json:"public_hostnames" yaml:"public_hostnames"`
}

Status

func (*Status) Descriptor

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

func (*Status) GetBidEngine

func (m *Status) GetBidEngine() *BidEngineStatus

func (*Status) GetCluster

func (m *Status) GetCluster() *ClusterStatus

func (*Status) GetErrors

func (m *Status) GetErrors() []string

func (*Status) GetManifest

func (m *Status) GetManifest() *ManifestStatus

func (*Status) GetPublicHostnames

func (m *Status) GetPublicHostnames() []string

func (*Status) Marshal

func (m *Status) Marshal() (dAtA []byte, err error)

func (*Status) MarshalTo

func (m *Status) MarshalTo(dAtA []byte) (int, error)

func (*Status) MarshalToSizedBuffer

func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) Size

func (m *Status) Size() (n int)

func (*Status) String

func (m *Status) String() string

func (*Status) Unmarshal

func (m *Status) Unmarshal(dAtA []byte) error

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Status) XXX_Merge

func (m *Status) XXX_Merge(src proto.Message)

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

func (m *Status) XXX_Unmarshal(b []byte) error

type Storage

type Storage map[string]*resource.Quantity

type UnimplementedProviderRPCServer

type UnimplementedProviderRPCServer struct {
}

UnimplementedProviderRPCServer can be embedded to have forward compatible implementations.

func (*UnimplementedProviderRPCServer) GetStatus

func (*UnimplementedProviderRPCServer) StreamStatus

Jump to

Keyboard shortcuts

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