projects

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 16

Documentation

Overview

Package projects contains GCP project config definitions.

Index

Constants

This section is empty.

Variables

View Source
var File_go_chromium_org_luci_gce_api_projects_v1_config_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_gce_api_projects_v1_service_proto protoreflect.FileDescriptor

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterProjectsServer

func RegisterProjectsServer(s prpc.Registrar, srv ProjectsServer)

Types

type Config

type Config struct {

	// The names of GCE quota metrics to report.
	// https://cloud.google.com/compute/docs/reference/rest/v1/regions/list.
	Metric []string `protobuf:"bytes,1,rep,name=metric,proto3" json:"metric,omitempty"`
	// The name of a GCP project to report GCE quota utilization for.
	Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// The names of GCE regions to report.
	// https://cloud.google.com/compute/docs/reference/rest/v1/regions/list.
	Region []string `protobuf:"bytes,3,rep,name=region,proto3" json:"region,omitempty"`
	// Should only be set by the server. The revision of this config.
	Revision string `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"`
	// contains filtered or unexported fields
}

A config for a GCP project to report GCE quota utilization for.

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) FromProperty

func (cfg *Config) FromProperty(p datastore.Property) error

FromProperty implements datastore.PropertyConverter.

func (*Config) GetMetric

func (x *Config) GetMetric() []string

func (*Config) GetProject

func (x *Config) GetProject() string

func (*Config) GetRegion

func (x *Config) GetRegion() []string

func (*Config) GetRevision

func (x *Config) GetRevision() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) ToProperty

func (cfg *Config) ToProperty() (datastore.Property, error)

ToProperty implements datastore.PropertyConverter.

func (*Config) Validate

func (cfg *Config) Validate(c *validation.Context)

Validate validates this config.

type Configs

type Configs struct {

	// The projects to report GCE quota utilization for.
	Project []*Config `protobuf:"bytes,1,rep,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

A config for several projects to report GCE quota utilization for.

func (*Configs) Descriptor deprecated

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

Deprecated: Use Configs.ProtoReflect.Descriptor instead.

func (*Configs) GetProject

func (x *Configs) GetProject() []*Config

func (*Configs) ProtoMessage

func (*Configs) ProtoMessage()

func (*Configs) ProtoReflect

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

func (*Configs) Reset

func (x *Configs) Reset()

func (*Configs) String

func (x *Configs) String() string

func (*Configs) Validate

func (cfgs *Configs) Validate(c *validation.Context)

Validate validates these configs.

type DecoratedProjects

type DecoratedProjects struct {
	// Service is the service to decorate.
	Service ProjectsServer
	// Prelude is called for each method before forwarding the call to Service.
	// If Prelude returns an error, then the call is skipped and the error is
	// processed via the Postlude (if one is defined), or it is returned directly.
	Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error)
	// Postlude is called for each method after Service has processed the call, or
	// after the Prelude has returned an error. This takes the Service's
	// response proto (which may be nil) and/or any error. The decorated
	// service will return the response (possibly mutated) and error that Postlude
	// returns.
	Postlude func(ctx context.Context, methodName string, rsp proto.Message, err error) error
}

func (*DecoratedProjects) Delete

func (s *DecoratedProjects) Delete(ctx context.Context, req *DeleteRequest) (rsp *emptypb.Empty, err error)

func (*DecoratedProjects) Ensure

func (s *DecoratedProjects) Ensure(ctx context.Context, req *EnsureRequest) (rsp *Config, err error)

func (*DecoratedProjects) Get

func (s *DecoratedProjects) Get(ctx context.Context, req *GetRequest) (rsp *Config, err error)

func (*DecoratedProjects) List

func (s *DecoratedProjects) List(ctx context.Context, req *ListRequest) (rsp *ListResponse, err error)

type DeleteRequest

type DeleteRequest struct {

	// The id of the project to delete.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A request to delete a project.

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type EnsureRequest

type EnsureRequest struct {

	// The id of the project to ensure.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The project.
	Project *Config `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
	// contains filtered or unexported fields
}

A request to create or update a project.

func (*EnsureRequest) Descriptor deprecated

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

Deprecated: Use EnsureRequest.ProtoReflect.Descriptor instead.

func (*EnsureRequest) GetId

func (x *EnsureRequest) GetId() string

func (*EnsureRequest) GetProject

func (x *EnsureRequest) GetProject() *Config

func (*EnsureRequest) ProtoMessage

func (*EnsureRequest) ProtoMessage()

func (*EnsureRequest) ProtoReflect

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

func (*EnsureRequest) Reset

func (x *EnsureRequest) Reset()

func (*EnsureRequest) String

func (x *EnsureRequest) String() string

type GetRequest

type GetRequest struct {

	// The id of the project to get.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A request to get an existing project.

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetId

func (x *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type ListRequest

type ListRequest struct {

	// The value of next_page_token received in a ListResponse. Used to get the
	// next page of projects. If empty, gets the first page.
	PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// The maximum number of results to include in the response.
	PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

A request to list existing projects.

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetPageSize

func (x *ListRequest) GetPageSize() int32

func (*ListRequest) GetPageToken

func (x *ListRequest) GetPageToken() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {

	// The projects.
	Projects []*Config `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"`
	// The value to use as the page_token in a ListRequest to get the next page of
	// projects. If empty, there are no more projects.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

A response to a request to list projects.

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetNextPageToken

func (x *ListResponse) GetNextPageToken() string

func (*ListResponse) GetProjects

func (x *ListResponse) GetProjects() []*Config

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type ProjectsClient

type ProjectsClient interface {
	// Delete deletes a project.
	// Internal API.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Ensure ensures a project exists.
	// Creates a new project or updates an existing one as necessary.
	// Internal API.
	Ensure(ctx context.Context, in *EnsureRequest, opts ...grpc.CallOption) (*Config, error)
	// Get returns an existing project.
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Config, error)
	// List returns existing projects.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
}

ProjectsClient is the client API for Projects service.

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

func NewProjectsClient

func NewProjectsClient(cc grpc.ClientConnInterface) ProjectsClient

func NewProjectsPRPCClient

func NewProjectsPRPCClient(client *prpc.Client) ProjectsClient

type ProjectsServer

type ProjectsServer interface {
	// Delete deletes a project.
	// Internal API.
	Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
	// Ensure ensures a project exists.
	// Creates a new project or updates an existing one as necessary.
	// Internal API.
	Ensure(context.Context, *EnsureRequest) (*Config, error)
	// Get returns an existing project.
	Get(context.Context, *GetRequest) (*Config, error)
	// List returns existing projects.
	List(context.Context, *ListRequest) (*ListResponse, error)
}

ProjectsServer is the server API for Projects service.

type UnimplementedProjectsServer

type UnimplementedProjectsServer struct {
}

UnimplementedProjectsServer can be embedded to have forward compatible implementations.

func (*UnimplementedProjectsServer) Delete

func (*UnimplementedProjectsServer) Ensure

func (*UnimplementedProjectsServer) Get

func (*UnimplementedProjectsServer) List

Jump to

Keyboard shortcuts

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