v1

package
v0.1.54 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package v1 contains the v1 GRPC client and server definitions for implementing Ecosystem interactions for the Console.

Index

Examples

Constants

View Source
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

View Source
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.

View Source
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)

View Source
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

func NewClients(ctx context.Context, ecoURL string, token string) (Clients, error)
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.

const (
	Ecosystem_UNKNOWN    Ecosystem = 0
	Ecosystem_JAVA       Ecosystem = 1
	Ecosystem_PYTHON     Ecosystem = 2
	Ecosystem_JAVASCRIPT Ecosystem = 3
)

func (Ecosystem) Descriptor

func (Ecosystem) Descriptor() protoreflect.EnumDescriptor

func (Ecosystem) Enum

func (x Ecosystem) Enum() *Ecosystem

func (Ecosystem) EnumDescriptor deprecated

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

Deprecated: Use Ecosystem.Descriptor instead.

func (Ecosystem) Number

func (x Ecosystem) Number() protoreflect.EnumNumber

func (Ecosystem) String

func (x Ecosystem) String() string

func (Ecosystem) Type

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.

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) Delete

func (UnimplementedEntitlementsServer) List

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.

Directories

Path Synopsis
Package test provides mock implementations of the ecosystems v1 gRPC clients for use in unit tests.
Package test provides mock implementations of the ecosystems v1 gRPC clients for use in unit tests.

Jump to

Keyboard shortcuts

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