registrar

package
v0.0.0-...-6a78f4a Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package registrar is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeType_name = map[int32]string{
		0: "TPM",
		1: "GCP",
		2: "AWS",
		3: "AZURE",
		4: "GITHUB",
	}
	NodeType_value = map[string]int32{
		"TPM":    0,
		"GCP":    1,
		"AWS":    2,
		"AZURE":  3,
		"GITHUB": 4,
	}
)

Enum value maps for NodeType.

View Source
var (
	WorkloadType_name = map[int32]string{
		0: "OCI",
		1: "BIN",
	}
	WorkloadType_value = map[string]int32{
		"OCI": 0,
		"BIN": 1,
	}
)

Enum value maps for WorkloadType.

View Source
var File_registrar_proto protoreflect.FileDescriptor
View Source
var Registrar_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "registrar.Registrar",
	HandlerType: (*RegistrarServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterNode",
			Handler:    _Registrar_RegisterNode_Handler,
		},
		{
			MethodName: "RegisterWorkload",
			Handler:    _Registrar_RegisterWorkload_Handler,
		},
		{
			MethodName: "GetAccount",
			Handler:    _Registrar_GetAccount_Handler,
		},
		{
			MethodName: "GetNodeRegistrations",
			Handler:    _Registrar_GetNodeRegistrations_Handler,
		},
		{
			MethodName: "DeactivateNode",
			Handler:    _Registrar_DeactivateNode_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "registrar.proto",
}

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

Functions

func RegisterRegistrarHandler

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

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

func RegisterRegistrarHandlerClient

func RegisterRegistrarHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RegistrarClient) error

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

func RegisterRegistrarHandlerFromEndpoint

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

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

func RegisterRegistrarHandlerServer

func RegisterRegistrarHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RegistrarServer) error

RegisterRegistrarHandlerServer registers the http handlers for service Registrar to "mux". UnaryRPC :call RegistrarServer 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 RegisterRegistrarHandlerFromEndpoint instead.

func RegisterRegistrarServer

func RegisterRegistrarServer(s grpc.ServiceRegistrar, srv RegistrarServer)

Types

type DecativateNodeRequest

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

func (*DecativateNodeRequest) Descriptor deprecated

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

Deprecated: Use DecativateNodeRequest.ProtoReflect.Descriptor instead.

func (*DecativateNodeRequest) GetNodeId

func (x *DecativateNodeRequest) GetNodeId() string

func (*DecativateNodeRequest) ProtoMessage

func (*DecativateNodeRequest) ProtoMessage()

func (*DecativateNodeRequest) ProtoReflect

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

func (*DecativateNodeRequest) Reset

func (x *DecativateNodeRequest) Reset()

func (*DecativateNodeRequest) String

func (x *DecativateNodeRequest) String() string

type GetAccountRequest

type GetAccountRequest struct {
	Selectors *SelectorList `protobuf:"bytes,1,opt,name=selectors,proto3" json:"selectors,omitempty"`
	NodeType  NodeType      `protobuf:"varint,2,opt,name=nodeType,proto3,enum=registrar.NodeType" json:"nodeType,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAccountRequest) Descriptor deprecated

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

Deprecated: Use GetAccountRequest.ProtoReflect.Descriptor instead.

func (*GetAccountRequest) GetNodeType

func (x *GetAccountRequest) GetNodeType() NodeType

func (*GetAccountRequest) GetSelectors

func (x *GetAccountRequest) GetSelectors() *SelectorList

func (*GetAccountRequest) ProtoMessage

func (*GetAccountRequest) ProtoMessage()

func (*GetAccountRequest) ProtoReflect

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

func (*GetAccountRequest) Reset

func (x *GetAccountRequest) Reset()

func (*GetAccountRequest) String

func (x *GetAccountRequest) String() string

type GetAccountResponse

type GetAccountResponse struct {
	Account   string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	NodeGroup string `protobuf:"bytes,2,opt,name=nodeGroup,proto3" json:"nodeGroup,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAccountResponse) Descriptor deprecated

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

Deprecated: Use GetAccountResponse.ProtoReflect.Descriptor instead.

func (*GetAccountResponse) GetAccount

func (x *GetAccountResponse) GetAccount() string

func (*GetAccountResponse) GetNodeGroup

func (x *GetAccountResponse) GetNodeGroup() string

func (*GetAccountResponse) ProtoMessage

func (*GetAccountResponse) ProtoMessage()

func (*GetAccountResponse) ProtoReflect

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

func (*GetAccountResponse) Reset

func (x *GetAccountResponse) Reset()

func (*GetAccountResponse) String

func (x *GetAccountResponse) String() string

type GetNodeRegistrationsResponse

type GetNodeRegistrationsResponse struct {
	NodeRegistrations []*NodeRegistration `protobuf:"bytes,1,rep,name=nodeRegistrations,proto3" json:"nodeRegistrations,omitempty"`
	// contains filtered or unexported fields
}

func (*GetNodeRegistrationsResponse) Descriptor deprecated

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

Deprecated: Use GetNodeRegistrationsResponse.ProtoReflect.Descriptor instead.

func (*GetNodeRegistrationsResponse) GetNodeRegistrations

func (x *GetNodeRegistrationsResponse) GetNodeRegistrations() []*NodeRegistration

func (*GetNodeRegistrationsResponse) ProtoMessage

func (*GetNodeRegistrationsResponse) ProtoMessage()

func (*GetNodeRegistrationsResponse) ProtoReflect

func (*GetNodeRegistrationsResponse) Reset

func (x *GetNodeRegistrationsResponse) Reset()

func (*GetNodeRegistrationsResponse) String

type NodeRegistration

type NodeRegistration struct {
	NodeId       string                 `protobuf:"bytes,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
	NodeType     NodeType               `protobuf:"varint,2,opt,name=nodeType,proto3,enum=registrar.NodeType" json:"nodeType,omitempty"`
	Selectors    *SelectorList          `protobuf:"bytes,3,opt,name=selectors,proto3" json:"selectors,omitempty"`
	NodeGroup    string                 `protobuf:"bytes,4,opt,name=nodeGroup,proto3" json:"nodeGroup,omitempty"`
	RegisteredBy string                 `protobuf:"bytes,5,opt,name=registeredBy,proto3" json:"registeredBy,omitempty"`
	AccountUUID  string                 `protobuf:"bytes,6,opt,name=accountUUID,proto3" json:"accountUUID,omitempty"`
	RegisteredAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=registeredAt,proto3" json:"registeredAt,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeRegistration) Descriptor deprecated

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

Deprecated: Use NodeRegistration.ProtoReflect.Descriptor instead.

func (*NodeRegistration) GetAccountUUID

func (x *NodeRegistration) GetAccountUUID() string

func (*NodeRegistration) GetNodeGroup

func (x *NodeRegistration) GetNodeGroup() string

func (*NodeRegistration) GetNodeId

func (x *NodeRegistration) GetNodeId() string

func (*NodeRegistration) GetNodeType

func (x *NodeRegistration) GetNodeType() NodeType

func (*NodeRegistration) GetRegisteredAt

func (x *NodeRegistration) GetRegisteredAt() *timestamppb.Timestamp

func (*NodeRegistration) GetRegisteredBy

func (x *NodeRegistration) GetRegisteredBy() string

func (*NodeRegistration) GetSelectors

func (x *NodeRegistration) GetSelectors() *SelectorList

func (*NodeRegistration) ProtoMessage

func (*NodeRegistration) ProtoMessage()

func (*NodeRegistration) ProtoReflect

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

func (*NodeRegistration) Reset

func (x *NodeRegistration) Reset()

func (*NodeRegistration) String

func (x *NodeRegistration) String() string

type NodeType

type NodeType int32
const (
	NodeType_TPM    NodeType = 0
	NodeType_GCP    NodeType = 1
	NodeType_AWS    NodeType = 2
	NodeType_AZURE  NodeType = 3
	NodeType_GITHUB NodeType = 4
)

func (NodeType) Descriptor

func (NodeType) Descriptor() protoreflect.EnumDescriptor

func (NodeType) Enum

func (x NodeType) Enum() *NodeType

func (NodeType) EnumDescriptor deprecated

func (NodeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use NodeType.Descriptor instead.

func (NodeType) Number

func (x NodeType) Number() protoreflect.EnumNumber

func (NodeType) String

func (x NodeType) String() string

func (NodeType) Type

type RegisterNodeRequest

type RegisterNodeRequest struct {
	NodeType  NodeType      `protobuf:"varint,1,opt,name=nodeType,proto3,enum=registrar.NodeType" json:"nodeType,omitempty"`
	Selectors *SelectorList `protobuf:"bytes,2,opt,name=selectors,proto3" json:"selectors,omitempty"`
	NodeGroup string        `protobuf:"bytes,3,opt,name=nodeGroup,proto3" json:"nodeGroup,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterNodeRequest) Descriptor deprecated

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

Deprecated: Use RegisterNodeRequest.ProtoReflect.Descriptor instead.

func (*RegisterNodeRequest) GetNodeGroup

func (x *RegisterNodeRequest) GetNodeGroup() string

func (*RegisterNodeRequest) GetNodeType

func (x *RegisterNodeRequest) GetNodeType() NodeType

func (*RegisterNodeRequest) GetSelectors

func (x *RegisterNodeRequest) GetSelectors() *SelectorList

func (*RegisterNodeRequest) ProtoMessage

func (*RegisterNodeRequest) ProtoMessage()

func (*RegisterNodeRequest) ProtoReflect

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

func (*RegisterNodeRequest) Reset

func (x *RegisterNodeRequest) Reset()

func (*RegisterNodeRequest) String

func (x *RegisterNodeRequest) String() string

type RegisterResponse

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

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetSpiffeID

func (x *RegisterResponse) GetSpiffeID() string

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type RegisterWorkloadRequest

type RegisterWorkloadRequest struct {
	WorkloadType WorkloadType  `protobuf:"varint,1,opt,name=workloadType,proto3,enum=registrar.WorkloadType" json:"workloadType,omitempty"`
	Selectors    *SelectorList `protobuf:"bytes,2,opt,name=selectors,proto3" json:"selectors,omitempty"`
	NodeGroup    string        `protobuf:"bytes,3,opt,name=nodeGroup,proto3" json:"nodeGroup,omitempty"`
	WorkloadName string        `protobuf:"bytes,4,opt,name=workloadName,proto3" json:"workloadName,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterWorkloadRequest) Descriptor deprecated

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

Deprecated: Use RegisterWorkloadRequest.ProtoReflect.Descriptor instead.

func (*RegisterWorkloadRequest) GetNodeGroup

func (x *RegisterWorkloadRequest) GetNodeGroup() string

func (*RegisterWorkloadRequest) GetSelectors

func (x *RegisterWorkloadRequest) GetSelectors() *SelectorList

func (*RegisterWorkloadRequest) GetWorkloadName

func (x *RegisterWorkloadRequest) GetWorkloadName() string

func (*RegisterWorkloadRequest) GetWorkloadType

func (x *RegisterWorkloadRequest) GetWorkloadType() WorkloadType

func (*RegisterWorkloadRequest) ProtoMessage

func (*RegisterWorkloadRequest) ProtoMessage()

func (*RegisterWorkloadRequest) ProtoReflect

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

func (*RegisterWorkloadRequest) Reset

func (x *RegisterWorkloadRequest) Reset()

func (*RegisterWorkloadRequest) String

func (x *RegisterWorkloadRequest) String() string

type RegistrarClient

type RegistrarClient interface {
	RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	RegisterWorkload(ctx context.Context, in *RegisterWorkloadRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error)
	GetNodeRegistrations(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetNodeRegistrationsResponse, error)
	DeactivateNode(ctx context.Context, in *DecativateNodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

RegistrarClient is the client API for Registrar 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 NewRegistrarClient

func NewRegistrarClient(cc grpc.ClientConnInterface) RegistrarClient

type RegistrarServer

type RegistrarServer interface {
	RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterResponse, error)
	RegisterWorkload(context.Context, *RegisterWorkloadRequest) (*RegisterResponse, error)
	GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error)
	GetNodeRegistrations(context.Context, *emptypb.Empty) (*GetNodeRegistrationsResponse, error)
	DeactivateNode(context.Context, *DecativateNodeRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

RegistrarServer is the server API for Registrar service. All implementations must embed UnimplementedRegistrarServer for forward compatibility

type Selector

type Selector struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Selector) Descriptor deprecated

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

Deprecated: Use Selector.ProtoReflect.Descriptor instead.

func (*Selector) GetKey

func (x *Selector) GetKey() string

func (*Selector) GetValue

func (x *Selector) GetValue() string

func (*Selector) ProtoMessage

func (*Selector) ProtoMessage()

func (*Selector) ProtoReflect

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

func (*Selector) Reset

func (x *Selector) Reset()

func (*Selector) String

func (x *Selector) String() string

type SelectorList

type SelectorList struct {
	Selectors []*Selector `protobuf:"bytes,1,rep,name=selectors,proto3" json:"selectors,omitempty"`
	// contains filtered or unexported fields
}

func (*SelectorList) Descriptor deprecated

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

Deprecated: Use SelectorList.ProtoReflect.Descriptor instead.

func (*SelectorList) GetSelectors

func (x *SelectorList) GetSelectors() []*Selector

func (*SelectorList) ProtoMessage

func (*SelectorList) ProtoMessage()

func (*SelectorList) ProtoReflect

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

func (*SelectorList) Reset

func (x *SelectorList) Reset()

func (*SelectorList) String

func (x *SelectorList) String() string

type UnimplementedRegistrarServer

type UnimplementedRegistrarServer struct {
}

UnimplementedRegistrarServer must be embedded to have forward compatible implementations.

func (UnimplementedRegistrarServer) DeactivateNode

func (UnimplementedRegistrarServer) GetAccount

func (UnimplementedRegistrarServer) GetNodeRegistrations

func (UnimplementedRegistrarServer) RegisterNode

func (UnimplementedRegistrarServer) RegisterWorkload

type UnsafeRegistrarServer

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

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

type WorkloadType

type WorkloadType int32
const (
	WorkloadType_OCI WorkloadType = 0
	WorkloadType_BIN WorkloadType = 1
)

func (WorkloadType) Descriptor

func (WorkloadType) Enum

func (x WorkloadType) Enum() *WorkloadType

func (WorkloadType) EnumDescriptor deprecated

func (WorkloadType) EnumDescriptor() ([]byte, []int)

Deprecated: Use WorkloadType.Descriptor instead.

func (WorkloadType) Number

func (WorkloadType) String

func (x WorkloadType) String() string

func (WorkloadType) Type

Jump to

Keyboard shortcuts

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