Documentation ¶
Index ¶
- Constants
- Variables
- func NewUnsupportedState(state string) error
- type Error
- type Service
- type ServiceDiff
- type ServiceUsageService
- func (s *ServiceUsageService) ListAll(ctx context.Context, projectID string) ([]*Service, error)
- func (s *ServiceUsageService) ListByDiff(ctx context.Context, baseProjectID string, targetProjectID string) ([]*ServiceDiff, error)
- func (s *ServiceUsageService) ListByStateDisabled(ctx context.Context, projectID string) ([]*Service, error)
- func (s *ServiceUsageService) ListByStateEnabled(ctx context.Context, projectID string) ([]*Service, error)
- func (s *ServiceUsageService) SetState(ctx context.Context, name string, state string) error
Constants ¶
View Source
const ( // StateEnabled is Stateに設定するEnableの文字列 StateEnabled = "ENABLED" // StateDisabled is Stateに設定するDisableの文字列 StateDisabled = "DISABLED" )
Variables ¶
View Source
var ErrUnsupportedState = &Error{ Code: "UnsupportedState", Message: "unsupported state", KV: map[string]interface{}{}, }
ErrUnsupportedState is サポートしていないStateが渡された
Functions ¶
func NewUnsupportedState ¶
NewUnsupportedState is return ErrNotFound
Types ¶
type Error ¶
type Error struct { Code string Message string KV map[string]interface{} // contains filtered or unexported fields }
Error is Error情報を保持する struct
type Service ¶
type Service struct { Name string // ex. projects/{$PROJECT_NUMBER}/services/bigquery.googleapis.com APIName string // ex. bigquery.googleapis.com Parent string // ex. projects/{$PROJECT_NUMBER} State string // ENABLED or DISABLED }
Service is ServiceUsage service model https://cloud.google.com/service-usage/docs/reference/rest/v1/Service の内容を格納するためのもの config は現状では使ってないので、入れていない
type ServiceDiff ¶
type ServiceDiff struct { Base *Service Target *Service ExistsTarget bool // Targetが存在する場合はtrue. 基本的にはtrueのはずだが、αのものとかでもしかしたら、baseにはあるけど、targetにはないみたいなのがあるかもしれないので、存在している }
ServiceDiff is ServiceのDiffがある時に返す struct
type ServiceUsageService ¶
type ServiceUsageService struct {
// contains filtered or unexported fields
}
ServiceUsageService is ServiceUsage Service https://cloud.google.com/service-usage/docs/overview
func NewService ¶
func NewService(ctx context.Context, client *serviceusage.Service, crmv1Client *crmv1.Service) (*ServiceUsageService, error)
NewService is return ServiceUsageService
func (*ServiceUsageService) ListByDiff ¶
func (s *ServiceUsageService) ListByDiff(ctx context.Context, baseProjectID string, targetProjectID string) ([]*ServiceDiff, error)
ListByDiff is base と target のServiceUsageを比較して、Stateの差がある場合、target の ServiceUsage を返す
func (*ServiceUsageService) ListByStateDisabled ¶
func (s *ServiceUsageService) ListByStateDisabled(ctx context.Context, projectID string) ([]*Service, error)
ListByStateDisabled is 指定した ProjectID の Disable になっている ServiceUsage を取得する
func (*ServiceUsageService) ListByStateEnabled ¶
func (s *ServiceUsageService) ListByStateEnabled(ctx context.Context, projectID string) ([]*Service, error)
ListByStateEnabled is 指定した ProjectID の Enable になっている ServiceUsage を取得する
Click to show internal directories.
Click to hide internal directories.