iamutil

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Overview

THIS FILE IS AUTOGENERATED USING go generate. DO NOT EDIT.

Index

Constants

View Source
const (
	ServiceAccountMemberTmpl = "serviceAccount:%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Members []string `json:"members,omitempty"`
	Role    string   `json:"role,omitempty"`
}

type GeneratedResources

type GeneratedResources map[string]map[string]map[string]IamRestResource

GeneratedResources implements IamResourceParser - a value is generated using internal/generate_iam.go

func GetEnabledIamResources

func GetEnabledIamResources() GeneratedResources

func (GeneratedResources) GetRestConfig

func (apis GeneratedResources) GetRestConfig(rawName string, fullName *gcputil.FullResourceName, prefix string) (*IamRestResource, error)

func (GeneratedResources) Parse

func (apis GeneratedResources) Parse(rawName string) (IamResource, error)

type IamHandle

type IamHandle struct {
	// contains filtered or unexported fields
}

func GetIamHandle

func GetIamHandle(client *http.Client, userAgent string) *IamHandle

func (*IamHandle) GetIamPolicy

func (h *IamHandle) GetIamPolicy(ctx context.Context, r IamResource) (*Policy, error)

func (*IamHandle) SetIamPolicy

func (h *IamHandle) SetIamPolicy(ctx context.Context, r IamResource, p *Policy) (*Policy, error)

type IamResource

type IamResource interface {
	GetIamPolicyRequest() (*http.Request, error)
	SetIamPolicyRequest(*Policy) (req *http.Request, err error)
}

IamResource handles constructing HTTP requests for getting and setting IAM policies.

type IamResourceParser

type IamResourceParser interface {
	Parse(string) (IamResource, error)
}

IamResourceParser handles parsing resource ID and REST config from a given resource ID or name.

type IamRestResource

type IamRestResource struct {
	// Name is the base name of the resource
	// i.e. for a GCE instance: "instance"
	Name string

	// Type Key is the identifying path for the resource, or
	// the RESTful resource identifier without resource IDs
	// i.e. For a GCE instance: "projects/zones/instances"
	TypeKey string

	// Service Information
	// Service is the name of the service this resource belongs to.
	Service string

	// IsPreferredVersion is true if this version of the API/resource is preferred.
	IsPreferredVersion bool

	// IsPreferredVersion is true if this version of the API/resource is preferred.
	GetMethod RestMethod

	// IsPreferredVersion is true if this version of the API/resource is preferred.
	SetMethod RestMethod

	// Ordered parameters to be replaced in method paths
	Parameters []string

	// collection Id --> parameter to be replaced {} name
	CollectionReplacementKeys map[string]string
}

type Policy

type Policy struct {
	Bindings []*Binding `json:"bindings,omitempty"`
	Etag     string     `json:"etag,omitempty"`
}

func (*Policy) AddBindings

func (p *Policy) AddBindings(toAdd *PolicyDelta) (changed bool, updated *Policy)

func (*Policy) ChangedBindings

func (p *Policy) ChangedBindings(toAdd *PolicyDelta, toRemove *PolicyDelta) (changed bool, updated *Policy)

func (*Policy) RemoveBindings

func (p *Policy) RemoveBindings(toRemove *PolicyDelta) (changed bool, updated *Policy)

type PolicyDelta

type PolicyDelta struct {
	Roles util.StringSet
	Email string
}

type RestMethod

type RestMethod struct {
	HttpMethod    string
	BaseURL       string
	Path          string
	RequestFormat string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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