luci: go.chromium.org/luci/cipd/client/cipd/plugin/protocol Index | Files

package protocol

import "go.chromium.org/luci/cipd/client/cipd/plugin/protocol"

Package protocol hosts protobuf messages for the CIPD plugin system.

Index

Package Files

admission.pb.go admission_grpc.pb.go gen.go plugin.pb.go plugin_grpc.pb.go

Variables

var File_go_chromium_org_luci_cipd_client_cipd_plugin_protocol_admission_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_cipd_client_cipd_plugin_protocol_plugin_proto protoreflect.FileDescriptor

func RegisterAdmissionsServer Uses

func RegisterAdmissionsServer(s grpc.ServiceRegistrar, srv AdmissionsServer)

func RegisterHostServer Uses

func RegisterHostServer(s grpc.ServiceRegistrar, srv HostServer)

type Admission Uses

type Admission struct {
    AdmissionId string        `protobuf:"bytes,1,opt,name=admission_id,json=admissionId,proto3" json:"admission_id,omitempty"` // an opaque ID identifies this request
    ServiceUrl  string        `protobuf:"bytes,2,opt,name=service_url,json=serviceUrl,proto3" json:"service_url,omitempty"`    // https:// address of the CIPD backend
    Package     string        `protobuf:"bytes,3,opt,name=package,proto3" json:"package,omitempty"`                            // a package being installed
    Instance    *v1.ObjectRef `protobuf:"bytes,4,opt,name=instance,proto3" json:"instance,omitempty"`                          // a concrete package instance being installed
    // contains filtered or unexported fields
}

Admission is sent by CIPD client when it attempts to install a package.

The plugin may allow or forbid this via ResolveAdmission RPC.

func (*Admission) Descriptor Uses

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

Deprecated: Use Admission.ProtoReflect.Descriptor instead.

func (*Admission) GetAdmissionId Uses

func (x *Admission) GetAdmissionId() string

func (*Admission) GetInstance Uses

func (x *Admission) GetInstance() *v1.ObjectRef

func (*Admission) GetPackage Uses

func (x *Admission) GetPackage() string

func (*Admission) GetServiceUrl Uses

func (x *Admission) GetServiceUrl() string

func (*Admission) ProtoMessage Uses

func (*Admission) ProtoMessage()

func (*Admission) ProtoReflect Uses

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

func (*Admission) Reset Uses

func (x *Admission) Reset()

func (*Admission) String Uses

func (x *Admission) String() string

type AdmissionsClient Uses

type AdmissionsClient interface {
    // ListAdmissions returns a stream of admission requests to process.
    ListAdmissions(ctx context.Context, in *ListAdmissionsRequest, opts ...grpc.CallOption) (Admissions_ListAdmissionsClient, error)
    // ResolveAdmission submits a decision on an admission request.
    ResolveAdmission(ctx context.Context, in *ResolveAdmissionRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

AdmissionsClient is the client API for Admissions 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 NewAdmissionsClient Uses

func NewAdmissionsClient(cc grpc.ClientConnInterface) AdmissionsClient

type AdmissionsServer Uses

type AdmissionsServer interface {
    // ListAdmissions returns a stream of admission requests to process.
    ListAdmissions(*ListAdmissionsRequest, Admissions_ListAdmissionsServer) error
    // ResolveAdmission submits a decision on an admission request.
    ResolveAdmission(context.Context, *ResolveAdmissionRequest) (*empty.Empty, error)
    // contains filtered or unexported methods
}

AdmissionsServer is the server API for Admissions service. All implementations must embed UnimplementedAdmissionsServer for forward compatibility

type Admissions_ListAdmissionsClient Uses

type Admissions_ListAdmissionsClient interface {
    Recv() (*Admission, error)
    grpc.ClientStream
}

type Admissions_ListAdmissionsServer Uses

type Admissions_ListAdmissionsServer interface {
    Send(*Admission) error
    grpc.ServerStream
}

type Handshake Uses

type Handshake struct {
    Port   int32  `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`    // localhost TCP port to connect to
    Ticket string `protobuf:"bytes,2,opt,name=ticket,proto3" json:"ticket,omitempty"` // a secret string to send as x-plugin-ticket metadata
    // contains filtered or unexported fields
}

Handshake is sent in a compact (no new lines) JSONPB encoding over stdin from the plugin host (e.g. CIPD client) to the plugin process.

It instructs the plugin how to connect and authenticate to the host.

func (*Handshake) Descriptor Uses

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

Deprecated: Use Handshake.ProtoReflect.Descriptor instead.

func (*Handshake) GetPort Uses

func (x *Handshake) GetPort() int32

func (*Handshake) GetTicket Uses

func (x *Handshake) GetTicket() string

func (*Handshake) ProtoMessage Uses

func (*Handshake) ProtoMessage()

func (*Handshake) ProtoReflect Uses

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

func (*Handshake) Reset Uses

func (x *Handshake) Reset()

func (*Handshake) String Uses

func (x *Handshake) String() string

type HostClient Uses

type HostClient interface {
    // Log adds a logging message to the CIPD client logging output.
    Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*empty.Empty, error)
    // Lists metadata entries attached to a package instance.
    //
    // Either returns all metadata or only entries with requested keys. The list
    // is sorted by the registration time of metadata entries (the most recent
    // first).
    //
    // Returns one page of the results. Use `next_page_token` to fetch the next
    // page. The last page has `next_page_token` empty.
    ListMetadata(ctx context.Context, in *ListMetadataRequest, opts ...grpc.CallOption) (*ListMetadataResponse, error)
}

HostClient is the client API for Host 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 NewHostClient Uses

func NewHostClient(cc grpc.ClientConnInterface) HostClient

type HostServer Uses

type HostServer interface {
    // Log adds a logging message to the CIPD client logging output.
    Log(context.Context, *LogRequest) (*empty.Empty, error)
    // Lists metadata entries attached to a package instance.
    //
    // Either returns all metadata or only entries with requested keys. The list
    // is sorted by the registration time of metadata entries (the most recent
    // first).
    //
    // Returns one page of the results. Use `next_page_token` to fetch the next
    // page. The last page has `next_page_token` empty.
    ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error)
    // contains filtered or unexported methods
}

HostServer is the server API for Host service. All implementations must embed UnimplementedHostServer for forward compatibility

type ListAdmissionsRequest Uses

type ListAdmissionsRequest struct {
    ProtocolVersion int32  `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // currently should be 1
    PluginVersion   string `protobuf:"bytes,2,opt,name=plugin_version,json=pluginVersion,proto3" json:"plugin_version,omitempty"`        // arbitrary string for logs
    // contains filtered or unexported fields
}

ListAdmissionsRequest carries arguments for ListAdmissions RPC.

func (*ListAdmissionsRequest) Descriptor Uses

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

Deprecated: Use ListAdmissionsRequest.ProtoReflect.Descriptor instead.

func (*ListAdmissionsRequest) GetPluginVersion Uses

func (x *ListAdmissionsRequest) GetPluginVersion() string

func (*ListAdmissionsRequest) GetProtocolVersion Uses

func (x *ListAdmissionsRequest) GetProtocolVersion() int32

func (*ListAdmissionsRequest) ProtoMessage Uses

func (*ListAdmissionsRequest) ProtoMessage()

func (*ListAdmissionsRequest) ProtoReflect Uses

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

func (*ListAdmissionsRequest) Reset Uses

func (x *ListAdmissionsRequest) Reset()

func (*ListAdmissionsRequest) String Uses

func (x *ListAdmissionsRequest) String() string

type ListMetadataRequest Uses

type ListMetadataRequest struct {

    // URL ("https://...") of the CIPD backend that hosts the package.
    ServiceUrl string `protobuf:"bytes,1,opt,name=service_url,json=serviceUrl,proto3" json:"service_url,omitempty"`
    // The package that holds the instance we list metadata of.
    Package string `protobuf:"bytes,2,opt,name=package,proto3" json:"package,omitempty"`
    // The instance to list metadata of.
    Instance *v1.ObjectRef `protobuf:"bytes,3,opt,name=instance,proto3" json:"instance,omitempty"`
    // Metadata keys to limit the listing to or empty to list all metadata.
    Keys []string `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"`
    // Maximum number of results to return on one page.
    PageSize int32 `protobuf:"varint,20,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
    // Value of 'next_page_token' from the previous response.
    PageToken string `protobuf:"bytes,21,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
    // contains filtered or unexported fields
}

ListMetadataRequest contains arguments for ListMetadata RPC.

func (*ListMetadataRequest) Descriptor Uses

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

Deprecated: Use ListMetadataRequest.ProtoReflect.Descriptor instead.

func (*ListMetadataRequest) GetInstance Uses

func (x *ListMetadataRequest) GetInstance() *v1.ObjectRef

func (*ListMetadataRequest) GetKeys Uses

func (x *ListMetadataRequest) GetKeys() []string

func (*ListMetadataRequest) GetPackage Uses

func (x *ListMetadataRequest) GetPackage() string

func (*ListMetadataRequest) GetPageSize Uses

func (x *ListMetadataRequest) GetPageSize() int32

func (*ListMetadataRequest) GetPageToken Uses

func (x *ListMetadataRequest) GetPageToken() string

func (*ListMetadataRequest) GetServiceUrl Uses

func (x *ListMetadataRequest) GetServiceUrl() string

func (*ListMetadataRequest) ProtoMessage Uses

func (*ListMetadataRequest) ProtoMessage()

func (*ListMetadataRequest) ProtoReflect Uses

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

func (*ListMetadataRequest) Reset Uses

func (x *ListMetadataRequest) Reset()

func (*ListMetadataRequest) String Uses

func (x *ListMetadataRequest) String() string

type ListMetadataResponse Uses

type ListMetadataResponse struct {

    // Discovered metadata ordered by 'attached_ts' (the most recent first).
    Metadata []*v1.InstanceMetadata `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty"`
    // Not empty if potentially have more metadata, can be passed to ListMetadata.
    NextPageToken string `protobuf:"bytes,20,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
    // contains filtered or unexported fields
}

ListMetadataResponse contains one page of results.

func (*ListMetadataResponse) Descriptor Uses

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

Deprecated: Use ListMetadataResponse.ProtoReflect.Descriptor instead.

func (*ListMetadataResponse) GetMetadata Uses

func (x *ListMetadataResponse) GetMetadata() []*v1.InstanceMetadata

func (*ListMetadataResponse) GetNextPageToken Uses

func (x *ListMetadataResponse) GetNextPageToken() string

func (*ListMetadataResponse) ProtoMessage Uses

func (*ListMetadataResponse) ProtoMessage()

func (*ListMetadataResponse) ProtoReflect Uses

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

func (*ListMetadataResponse) Reset Uses

func (x *ListMetadataResponse) Reset()

func (*ListMetadataResponse) String Uses

func (x *ListMetadataResponse) String() string

type LogRequest Uses

type LogRequest struct {
    Severity string `protobuf:"bytes,1,opt,name=severity,proto3" json:"severity,omitempty"` // "debug", info", "warning", "error"
    Message  string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
    // contains filtered or unexported fields
}

LogRequest results in a logging line in the CIPD client log.

func (*LogRequest) Descriptor Uses

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

Deprecated: Use LogRequest.ProtoReflect.Descriptor instead.

func (*LogRequest) GetMessage Uses

func (x *LogRequest) GetMessage() string

func (*LogRequest) GetSeverity Uses

func (x *LogRequest) GetSeverity() string

func (*LogRequest) ProtoMessage Uses

func (*LogRequest) ProtoMessage()

func (*LogRequest) ProtoReflect Uses

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

func (*LogRequest) Reset Uses

func (x *LogRequest) Reset()

func (*LogRequest) String Uses

func (x *LogRequest) String() string

type ResolveAdmissionRequest Uses

type ResolveAdmissionRequest struct {
    AdmissionId string         `protobuf:"bytes,1,opt,name=admission_id,json=admissionId,proto3" json:"admission_id,omitempty"` // same as in the corresponding Admission
    Status      *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`                              // not OK if the deployment is denied
    // contains filtered or unexported fields
}

ResolveAdmissionRequest carries a judgment on some Admission.

func (*ResolveAdmissionRequest) Descriptor Uses

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

Deprecated: Use ResolveAdmissionRequest.ProtoReflect.Descriptor instead.

func (*ResolveAdmissionRequest) GetAdmissionId Uses

func (x *ResolveAdmissionRequest) GetAdmissionId() string

func (*ResolveAdmissionRequest) GetStatus Uses

func (x *ResolveAdmissionRequest) GetStatus() *status.Status

func (*ResolveAdmissionRequest) ProtoMessage Uses

func (*ResolveAdmissionRequest) ProtoMessage()

func (*ResolveAdmissionRequest) ProtoReflect Uses

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

func (*ResolveAdmissionRequest) Reset Uses

func (x *ResolveAdmissionRequest) Reset()

func (*ResolveAdmissionRequest) String Uses

func (x *ResolveAdmissionRequest) String() string

type UnimplementedAdmissionsServer Uses

type UnimplementedAdmissionsServer struct {
}

UnimplementedAdmissionsServer must be embedded to have forward compatible implementations.

func (UnimplementedAdmissionsServer) ListAdmissions Uses

func (UnimplementedAdmissionsServer) ListAdmissions(*ListAdmissionsRequest, Admissions_ListAdmissionsServer) error

func (UnimplementedAdmissionsServer) ResolveAdmission Uses

func (UnimplementedAdmissionsServer) ResolveAdmission(context.Context, *ResolveAdmissionRequest) (*empty.Empty, error)

type UnimplementedHostServer Uses

type UnimplementedHostServer struct {
}

UnimplementedHostServer must be embedded to have forward compatible implementations.

func (UnimplementedHostServer) ListMetadata Uses

func (UnimplementedHostServer) ListMetadata(context.Context, *ListMetadataRequest) (*ListMetadataResponse, error)

func (UnimplementedHostServer) Log Uses

func (UnimplementedHostServer) Log(context.Context, *LogRequest) (*empty.Empty, error)

type UnsafeAdmissionsServer Uses

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

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

type UnsafeHostServer Uses

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

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

Package protocol imports 12 packages (graph) and is imported by 3 packages. Updated 2020-11-27. Refresh now. Tools for package owners.