Documentation ¶
Overview ¶
Package projects contains GCP project config definitions.
Index ¶
- Variables
- func FileDescriptorSet() *descriptorpb.FileDescriptorSet
- func RegisterProjectsServer(s prpc.Registrar, srv ProjectsServer)
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (cfg *Config) FromProperty(p datastore.Property) error
- func (x *Config) GetMetric() []string
- func (x *Config) GetProject() string
- func (x *Config) GetRegion() []string
- func (x *Config) GetRevision() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (cfg *Config) ToProperty() (datastore.Property, error)
- func (cfg *Config) Validate(c *validation.Context)
- type Configs
- type DecoratedProjects
- func (s *DecoratedProjects) Delete(ctx context.Context, req *DeleteRequest) (rsp *emptypb.Empty, err error)
- func (s *DecoratedProjects) Ensure(ctx context.Context, req *EnsureRequest) (rsp *Config, err error)
- func (s *DecoratedProjects) Get(ctx context.Context, req *GetRequest) (rsp *Config, err error)
- func (s *DecoratedProjects) List(ctx context.Context, req *ListRequest) (rsp *ListResponse, err error)
- type DeleteRequest
- type EnsureRequest
- func (*EnsureRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EnsureRequest) GetId() string
- func (x *EnsureRequest) GetProject() *Config
- func (*EnsureRequest) ProtoMessage()
- func (x *EnsureRequest) ProtoReflect() protoreflect.Message
- func (x *EnsureRequest) Reset()
- func (x *EnsureRequest) String() string
- type GetRequest
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetPageSize() int32
- func (x *ListRequest) GetPageToken() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetNextPageToken() string
- func (x *ListResponse) GetProjects() []*Config
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- type ProjectsClient
- type ProjectsServer
- type UnimplementedProjectsServer
- func (*UnimplementedProjectsServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
- func (*UnimplementedProjectsServer) Ensure(context.Context, *EnsureRequest) (*Config, error)
- func (*UnimplementedProjectsServer) Get(context.Context, *GetRequest) (*Config, error)
- func (*UnimplementedProjectsServer) List(context.Context, *ListRequest) (*ListResponse, error)
Constants ¶
This section is empty.
Variables ¶
var File_go_chromium_org_luci_gce_api_projects_v1_config_proto protoreflect.FileDescriptor
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) FromProperty ¶
FromProperty implements datastore.PropertyConverter.
func (*Config) GetProject ¶
func (*Config) GetRevision ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) ToProperty ¶
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) GetProject ¶
func (*Configs) ProtoMessage ¶
func (*Configs) ProtoMessage()
func (*Configs) ProtoReflect ¶
func (x *Configs) ProtoReflect() protoreflect.Message
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) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
func (*UnimplementedProjectsServer) Ensure ¶
func (*UnimplementedProjectsServer) Ensure(context.Context, *EnsureRequest) (*Config, error)
func (*UnimplementedProjectsServer) Get ¶
func (*UnimplementedProjectsServer) Get(context.Context, *GetRequest) (*Config, error)
func (*UnimplementedProjectsServer) List ¶
func (*UnimplementedProjectsServer) List(context.Context, *ListRequest) (*ListResponse, error)