Back to godoc.org

Package projects

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package projects contains GCP project config definitions.

Index

func FileDescriptorSet

func FileDescriptorSet() *descriptor.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)

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Config) Descriptor

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

func (*Config) FromProperty

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

FromProperty implements datastore.PropertyConverter.

func (*Config) GetMetric

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

func (*Config) GetProject

func (m *Config) GetProject() string

func (*Config) GetRegion

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

func (*Config) GetRevision

func (m *Config) GetRevision() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *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.

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

func (m *Config) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

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

func (*Configs) Descriptor

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

func (*Configs) GetProject

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

func (*Configs) ProtoMessage

func (*Configs) ProtoMessage()

func (*Configs) Reset

func (m *Configs) Reset()

func (*Configs) String

func (m *Configs) String() string

func (*Configs) Validate

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

Validate validates these configs.

func (*Configs) XXX_DiscardUnknown

func (m *Configs) XXX_DiscardUnknown()

func (*Configs) XXX_Marshal

func (m *Configs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Configs) XXX_Merge

func (m *Configs) XXX_Merge(src proto.Message)

func (*Configs) XXX_Size

func (m *Configs) XXX_Size() int

func (*Configs) XXX_Unmarshal

func (m *Configs) XXX_Unmarshal(b []byte) error

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 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 *empty.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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A request to delete a project.

func (*DeleteRequest) Descriptor

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

func (*DeleteRequest) GetId

func (m *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) XXX_DiscardUnknown

func (m *DeleteRequest) XXX_DiscardUnknown()

func (*DeleteRequest) XXX_Marshal

func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRequest) XXX_Merge

func (m *DeleteRequest) XXX_Merge(src proto.Message)

func (*DeleteRequest) XXX_Size

func (m *DeleteRequest) XXX_Size() int

func (*DeleteRequest) XXX_Unmarshal

func (m *DeleteRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A request to create or update a project.

func (*EnsureRequest) Descriptor

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

func (*EnsureRequest) GetId

func (m *EnsureRequest) GetId() string

func (*EnsureRequest) GetProject

func (m *EnsureRequest) GetProject() *Config

func (*EnsureRequest) ProtoMessage

func (*EnsureRequest) ProtoMessage()

func (*EnsureRequest) Reset

func (m *EnsureRequest) Reset()

func (*EnsureRequest) String

func (m *EnsureRequest) String() string

func (*EnsureRequest) XXX_DiscardUnknown

func (m *EnsureRequest) XXX_DiscardUnknown()

func (*EnsureRequest) XXX_Marshal

func (m *EnsureRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EnsureRequest) XXX_Merge

func (m *EnsureRequest) XXX_Merge(src proto.Message)

func (*EnsureRequest) XXX_Size

func (m *EnsureRequest) XXX_Size() int

func (*EnsureRequest) XXX_Unmarshal

func (m *EnsureRequest) XXX_Unmarshal(b []byte) error

type GetRequest

type GetRequest struct {
	// The id of the project to get.
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A request to get an existing project.

func (*GetRequest) Descriptor

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

func (*GetRequest) GetId

func (m *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (m *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A request to list existing projects.

func (*ListRequest) Descriptor

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

func (*ListRequest) GetPageSize

func (m *ListRequest) GetPageSize() int32

func (*ListRequest) GetPageToken

func (m *ListRequest) GetPageToken() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

func (*ListRequest) XXX_DiscardUnknown

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal

func (m *ListRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A response to a request to list projects.

func (*ListResponse) Descriptor

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

func (*ListResponse) GetNextPageToken

func (m *ListResponse) GetNextPageToken() string

func (*ListResponse) GetProjects

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

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset

func (m *ListResponse) Reset()

func (*ListResponse) String

func (m *ListResponse) String() string

func (*ListResponse) XXX_DiscardUnknown

func (m *ListResponse) XXX_DiscardUnknown()

func (*ListResponse) XXX_Marshal

func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListResponse) XXX_Merge

func (m *ListResponse) XXX_Merge(src proto.Message)

func (*ListResponse) XXX_Size

func (m *ListResponse) XXX_Size() int

func (*ListResponse) XXX_Unmarshal

func (m *ListResponse) XXX_Unmarshal(b []byte) error

type ProjectsClient

type ProjectsClient interface {
	// Delete deletes a project.
	// Internal API.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*empty.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 NewProjectsPRPCClient

func NewProjectsPRPCClient(client *prpc.Client) ProjectsClient

type ProjectsServer

type ProjectsServer interface {
	// Delete deletes a project.
	// Internal API.
	Delete(context.Context, *DeleteRequest) (*empty.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(ctx context.Context, req *DeleteRequest) (*empty.Empty, error)

func (*UnimplementedProjectsServer) Ensure

func (*UnimplementedProjectsServer) Ensure(ctx context.Context, req *EnsureRequest) (*Config, error)

func (*UnimplementedProjectsServer) Get

func (*UnimplementedProjectsServer) Get(ctx context.Context, req *GetRequest) (*Config, error)

func (*UnimplementedProjectsServer) List

func (*UnimplementedProjectsServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier