Documentation
¶
Overview ¶
Package v1 contains the v1 GRPC client and server definitions for implementing Ecosystem interactions for the Console.
Index ¶
- Constants
- Variables
- func RegisterEntitlementsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEntitlementsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EntitlementsClient) error
- func RegisterEntitlementsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEntitlementsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EntitlementsServer) error
- func RegisterEntitlementsServer(s grpc.ServiceRegistrar, srv EntitlementsServer)
- type Clients
- type CreateEntitlementRequestdeprecated
- func (*CreateEntitlementRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateEntitlementRequest) GetEcosystem() Ecosystem
- func (x *CreateEntitlementRequest) GetParentId() string
- func (*CreateEntitlementRequest) ProtoMessage()
- func (x *CreateEntitlementRequest) ProtoReflect() protoreflect.Message
- func (x *CreateEntitlementRequest) Reset()
- func (x *CreateEntitlementRequest) String() string
- type DeleteEntitlementRequestdeprecated
- func (*DeleteEntitlementRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteEntitlementRequest) GetId() string
- func (*DeleteEntitlementRequest) ProtoMessage()
- func (x *DeleteEntitlementRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteEntitlementRequest) Reset()
- func (x *DeleteEntitlementRequest) String() string
- type Ecosystem
- type Entitlementdeprecated
- func (*Entitlement) Descriptor() ([]byte, []int)deprecated
- func (x *Entitlement) GetEcosystem() Ecosystem
- func (x *Entitlement) GetId() string
- func (*Entitlement) ProtoMessage()
- func (x *Entitlement) ProtoReflect() protoreflect.Message
- func (x *Entitlement) Reset()
- func (x *Entitlement) String() string
- type EntitlementFilterdeprecated
- func (*EntitlementFilter) Descriptor() ([]byte, []int)deprecated
- func (x *EntitlementFilter) GetEcosystems() []Ecosystem
- func (x *EntitlementFilter) GetParentId() string
- func (*EntitlementFilter) ProtoMessage()
- func (x *EntitlementFilter) ProtoReflect() protoreflect.Message
- func (x *EntitlementFilter) Reset()
- func (x *EntitlementFilter) String() string
- type EntitlementListdeprecated
- type EntitlementsClient
- type EntitlementsServer
- type UnimplementedEntitlementsServer
- func (UnimplementedEntitlementsServer) Create(context.Context, *CreateEntitlementRequest) (*Entitlement, error)
- func (UnimplementedEntitlementsServer) Delete(context.Context, *DeleteEntitlementRequest) (*emptypb.Empty, error)
- func (UnimplementedEntitlementsServer) List(context.Context, *EntitlementFilter) (*EntitlementList, error)
- type UnsafeEntitlementsServer
Examples ¶
Constants ¶
const ( Entitlements_Create_FullMethodName = "/chainguard.platform.ecosystems.Entitlements/Create" Entitlements_List_FullMethodName = "/chainguard.platform.ecosystems.Entitlements/List" Entitlements_Delete_FullMethodName = "/chainguard.platform.ecosystems.Entitlements/Delete" )
Variables ¶
var ( Ecosystem_name = map[int32]string{ 0: "UNKNOWN", 1: "JAVA", 2: "PYTHON", 3: "JAVASCRIPT", } Ecosystem_value = map[string]int32{ "UNKNOWN": 0, "JAVA": 1, "PYTHON": 2, "JAVASCRIPT": 3, } )
Enum value maps for Ecosystem.
var Entitlements_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chainguard.platform.ecosystems.Entitlements", HandlerType: (*EntitlementsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _Entitlements_Create_Handler, }, { MethodName: "List", Handler: _Entitlements_List_Handler, }, { MethodName: "Delete", Handler: _Entitlements_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "entitlements.platform.proto", }
Entitlements_ServiceDesc is the grpc.ServiceDesc for Entitlements service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_entitlements_platform_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEntitlementsHandler ¶
func RegisterEntitlementsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEntitlementsHandler registers the http handlers for service Entitlements to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEntitlementsHandlerClient ¶
func RegisterEntitlementsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EntitlementsClient) error
RegisterEntitlementsHandlerClient registers the http handlers for service Entitlements to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EntitlementsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EntitlementsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EntitlementsClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterEntitlementsHandlerFromEndpoint ¶
func RegisterEntitlementsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEntitlementsHandlerFromEndpoint is same as RegisterEntitlementsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEntitlementsHandlerServer ¶
func RegisterEntitlementsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EntitlementsServer) error
RegisterEntitlementsHandlerServer registers the http handlers for service Entitlements to "mux". UnaryRPC :call EntitlementsServer 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 RegisterEntitlementsHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterEntitlementsServer ¶
func RegisterEntitlementsServer(s grpc.ServiceRegistrar, srv EntitlementsServer)
Types ¶
type Clients ¶
type Clients interface {
Entitlements() EntitlementsClient
Close() error
}
func NewClients ¶
Example ¶
ExampleNewClients demonstrates that an invalid address returns an error.
package main
import (
"context"
"fmt"
ecosystemsv1 "chainguard.dev/sdk/proto/platform/ecosystems/v1"
)
func main() {
ctx := context.Background()
_, err := ecosystemsv1.NewClients(ctx, "http://%zz", "")
fmt.Println(err != nil)
}
Output: true
func NewClientsFromConnection ¶
func NewClientsFromConnection(conn *grpc.ClientConn) Clients
type CreateEntitlementRequest
deprecated
type CreateEntitlementRequest struct {
// parent_id is the group to create the entitlement for.
ParentId string `protobuf:"bytes,1,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
// ecosystem is the language ecosystem to entitle this group to.
Ecosystem Ecosystem `protobuf:"varint,2,opt,name=ecosystem,proto3,enum=chainguard.platform.ecosystems.Ecosystem" json:"ecosystem,omitempty"`
// contains filtered or unexported fields
}
This service is deprecated. Use chainguard.platform.libraries.CreateEntitlementRequest
Deprecated: Marked as deprecated in entitlements.platform.proto.
func (*CreateEntitlementRequest) Descriptor
deprecated
func (*CreateEntitlementRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateEntitlementRequest.ProtoReflect.Descriptor instead.
func (*CreateEntitlementRequest) GetEcosystem ¶
func (x *CreateEntitlementRequest) GetEcosystem() Ecosystem
func (*CreateEntitlementRequest) GetParentId ¶
func (x *CreateEntitlementRequest) GetParentId() string
func (*CreateEntitlementRequest) ProtoMessage ¶
func (*CreateEntitlementRequest) ProtoMessage()
func (*CreateEntitlementRequest) ProtoReflect ¶
func (x *CreateEntitlementRequest) ProtoReflect() protoreflect.Message
func (*CreateEntitlementRequest) Reset ¶
func (x *CreateEntitlementRequest) Reset()
func (*CreateEntitlementRequest) String ¶
func (x *CreateEntitlementRequest) String() string
type DeleteEntitlementRequest
deprecated
type DeleteEntitlementRequest struct {
// id is the exact uidp of the entitlement to delete.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
This service is deprecated. Use chainguard.platform.libraries.DeleteEntitlementRequest
Deprecated: Marked as deprecated in entitlements.platform.proto.
func (*DeleteEntitlementRequest) Descriptor
deprecated
func (*DeleteEntitlementRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteEntitlementRequest.ProtoReflect.Descriptor instead.
func (*DeleteEntitlementRequest) GetId ¶
func (x *DeleteEntitlementRequest) GetId() string
func (*DeleteEntitlementRequest) ProtoMessage ¶
func (*DeleteEntitlementRequest) ProtoMessage()
func (*DeleteEntitlementRequest) ProtoReflect ¶
func (x *DeleteEntitlementRequest) ProtoReflect() protoreflect.Message
func (*DeleteEntitlementRequest) Reset ¶
func (x *DeleteEntitlementRequest) Reset()
func (*DeleteEntitlementRequest) String ¶
func (x *DeleteEntitlementRequest) String() string
type Ecosystem ¶
type Ecosystem int32
Ecosystem represents the language libraries an org can be entitled to.
func (Ecosystem) Descriptor ¶
func (Ecosystem) Descriptor() protoreflect.EnumDescriptor
func (Ecosystem) EnumDescriptor
deprecated
func (Ecosystem) Number ¶
func (x Ecosystem) Number() protoreflect.EnumNumber
func (Ecosystem) Type ¶
func (Ecosystem) Type() protoreflect.EnumType
type Entitlement
deprecated
type Entitlement struct {
// id is the uidp of the entitlement, a child of a group.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// ecosystem is the language ecosystem this entitlement grants access to.
Ecosystem Ecosystem `protobuf:"varint,2,opt,name=ecosystem,proto3,enum=chainguard.platform.ecosystems.Ecosystem" json:"ecosystem,omitempty"`
// contains filtered or unexported fields
}
Entitlement maps an org to an library ecosystem they are entitled to pull. This service is deprecated. Use chainguard.platform.libraries.Entitlement
Deprecated: Marked as deprecated in entitlements.platform.proto.
func (*Entitlement) Descriptor
deprecated
func (*Entitlement) Descriptor() ([]byte, []int)
Deprecated: Use Entitlement.ProtoReflect.Descriptor instead.
func (*Entitlement) GetEcosystem ¶
func (x *Entitlement) GetEcosystem() Ecosystem
func (*Entitlement) GetId ¶
func (x *Entitlement) GetId() string
func (*Entitlement) ProtoMessage ¶
func (*Entitlement) ProtoMessage()
func (*Entitlement) ProtoReflect ¶
func (x *Entitlement) ProtoReflect() protoreflect.Message
func (*Entitlement) Reset ¶
func (x *Entitlement) Reset()
func (*Entitlement) String ¶
func (x *Entitlement) String() string
type EntitlementFilter
deprecated
type EntitlementFilter struct {
// parent_id is the group to list entitlements for. Required.
ParentId string `protobuf:"bytes,1,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
// ecosystems are the language ecosystems to list entitlements for. If empty, all entitlements for the group will be listed.
Ecosystems []Ecosystem `` /* 127-byte string literal not displayed */
// contains filtered or unexported fields
}
This service is deprecated. Use chainguard.platform.libraries.EntitlementFilter
Deprecated: Marked as deprecated in entitlements.platform.proto.
func (*EntitlementFilter) Descriptor
deprecated
func (*EntitlementFilter) Descriptor() ([]byte, []int)
Deprecated: Use EntitlementFilter.ProtoReflect.Descriptor instead.
func (*EntitlementFilter) GetEcosystems ¶
func (x *EntitlementFilter) GetEcosystems() []Ecosystem
func (*EntitlementFilter) GetParentId ¶
func (x *EntitlementFilter) GetParentId() string
func (*EntitlementFilter) ProtoMessage ¶
func (*EntitlementFilter) ProtoMessage()
func (*EntitlementFilter) ProtoReflect ¶
func (x *EntitlementFilter) ProtoReflect() protoreflect.Message
func (*EntitlementFilter) Reset ¶
func (x *EntitlementFilter) Reset()
func (*EntitlementFilter) String ¶
func (x *EntitlementFilter) String() string
type EntitlementList
deprecated
type EntitlementList struct {
Items []*Entitlement `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
// contains filtered or unexported fields
}
This service is deprecated. Use chainguard.platform.libraries.EntitlementList
Deprecated: Marked as deprecated in entitlements.platform.proto.
func (*EntitlementList) Descriptor
deprecated
func (*EntitlementList) Descriptor() ([]byte, []int)
Deprecated: Use EntitlementList.ProtoReflect.Descriptor instead.
func (*EntitlementList) GetItems ¶
func (x *EntitlementList) GetItems() []*Entitlement
func (*EntitlementList) ProtoMessage ¶
func (*EntitlementList) ProtoMessage()
func (*EntitlementList) ProtoReflect ¶
func (x *EntitlementList) ProtoReflect() protoreflect.Message
func (*EntitlementList) Reset ¶
func (x *EntitlementList) Reset()
func (*EntitlementList) String ¶
func (x *EntitlementList) String() string
type EntitlementsClient ¶
type EntitlementsClient interface {
Create(ctx context.Context, in *CreateEntitlementRequest, opts ...grpc.CallOption) (*Entitlement, error)
List(ctx context.Context, in *EntitlementFilter, opts ...grpc.CallOption) (*EntitlementList, error)
Delete(ctx context.Context, in *DeleteEntitlementRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
EntitlementsClient is the client API for Entitlements 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 NewEntitlementsClient ¶
func NewEntitlementsClient(cc grpc.ClientConnInterface) EntitlementsClient
type EntitlementsServer ¶
type EntitlementsServer interface {
Create(context.Context, *CreateEntitlementRequest) (*Entitlement, error)
List(context.Context, *EntitlementFilter) (*EntitlementList, error)
Delete(context.Context, *DeleteEntitlementRequest) (*emptypb.Empty, error)
// contains filtered or unexported methods
}
EntitlementsServer is the server API for Entitlements service. All implementations must embed UnimplementedEntitlementsServer for forward compatibility.
type UnimplementedEntitlementsServer ¶
type UnimplementedEntitlementsServer struct{}
UnimplementedEntitlementsServer 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 (UnimplementedEntitlementsServer) Create ¶
func (UnimplementedEntitlementsServer) Create(context.Context, *CreateEntitlementRequest) (*Entitlement, error)
func (UnimplementedEntitlementsServer) Delete ¶
func (UnimplementedEntitlementsServer) Delete(context.Context, *DeleteEntitlementRequest) (*emptypb.Empty, error)
func (UnimplementedEntitlementsServer) List ¶
func (UnimplementedEntitlementsServer) List(context.Context, *EntitlementFilter) (*EntitlementList, error)
type UnsafeEntitlementsServer ¶
type UnsafeEntitlementsServer interface {
// contains filtered or unexported methods
}
UnsafeEntitlementsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EntitlementsServer will result in compilation errors.