resource

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package resource is a generated protocol buffer package.

It is generated from these files:

github.com/appcelerator/amp/api/rpc/resource/resource.proto

It has these top-level messages:

ResourceEntry
ListRequest
ListReply
AddToTeamRequest
RemoveFromTeamRequest
ChangePermissionLevelRequest

Package resource is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Action_name = map[int32]string{
	0: "ACTION_CREATE",
	1: "ACTION_READ",
	2: "ACTION_UPDATE",
	3: "ACTION_DELETE",
}
View Source
var Action_value = map[string]int32{
	"ACTION_CREATE": 0,
	"ACTION_READ":   1,
	"ACTION_UPDATE": 2,
	"ACTION_DELETE": 3,
}
View Source
var ResourceType_name = map[int32]string{
	0: "RESOURCE_STACK",
	1: "RESOURCE_DASHBOARD",
	2: "RESOURCE_USER",
	3: "RESOURCE_ORGANIZATION",
	4: "RESOURCE_TEAM",
}
View Source
var ResourceType_value = map[string]int32{
	"RESOURCE_STACK":        0,
	"RESOURCE_DASHBOARD":    1,
	"RESOURCE_USER":         2,
	"RESOURCE_ORGANIZATION": 3,
	"RESOURCE_TEAM":         4,
}

Functions

func RegisterResourceHandler

func RegisterResourceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterResourceHandler registers the http handlers for service Resource to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterResourceHandlerClient added in v0.16.0

func RegisterResourceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ResourceClient) error

RegisterResourceHandler registers the http handlers for service Resource to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ResourceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ResourceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ResourceClient" to call the correct interceptors.

func RegisterResourceHandlerFromEndpoint

func RegisterResourceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterResourceHandlerFromEndpoint is same as RegisterResourceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterResourceServer

func RegisterResourceServer(s *grpc.Server, srv ResourceServer)

Types

type Action

type Action int32
const (
	Action_ACTION_CREATE Action = 0
	Action_ACTION_READ   Action = 1
	Action_ACTION_UPDATE Action = 2
	Action_ACTION_DELETE Action = 3
)

func (Action) EnumDescriptor

func (Action) EnumDescriptor() ([]byte, []int)

func (Action) String

func (x Action) String() string

type AddToTeamRequest

type AddToTeamRequest struct {
	ResourceId       string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId" json:"resource_id,omitempty"`
	OrganizationName string `protobuf:"bytes,2,opt,name=organization_name,json=organizationName" json:"organization_name,omitempty"`
	TeamName         string `protobuf:"bytes,3,opt,name=team_name,json=teamName" json:"team_name,omitempty"`
}

func (*AddToTeamRequest) Descriptor

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

func (*AddToTeamRequest) GetOrganizationName

func (m *AddToTeamRequest) GetOrganizationName() string

func (*AddToTeamRequest) GetResourceId

func (m *AddToTeamRequest) GetResourceId() string

func (*AddToTeamRequest) GetTeamName

func (m *AddToTeamRequest) GetTeamName() string

func (*AddToTeamRequest) ProtoMessage

func (*AddToTeamRequest) ProtoMessage()

func (*AddToTeamRequest) Reset

func (m *AddToTeamRequest) Reset()

func (*AddToTeamRequest) String

func (m *AddToTeamRequest) String() string

type ChangePermissionLevelRequest

type ChangePermissionLevelRequest struct {
	OrganizationName string                       `protobuf:"bytes,1,opt,name=organization_name,json=organizationName" json:"organization_name,omitempty"`
	TeamName         string                       `protobuf:"bytes,2,opt,name=team_name,json=teamName" json:"team_name,omitempty"`
	ResourceId       string                       `protobuf:"bytes,3,opt,name=resource_id,json=resourceId" json:"resource_id,omitempty"`
	PermissionLevel  accounts.TeamPermissionLevel `` /* 134-byte string literal not displayed */
}

func (*ChangePermissionLevelRequest) Descriptor

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

func (*ChangePermissionLevelRequest) GetOrganizationName

func (m *ChangePermissionLevelRequest) GetOrganizationName() string

func (*ChangePermissionLevelRequest) GetPermissionLevel

func (*ChangePermissionLevelRequest) GetResourceId

func (m *ChangePermissionLevelRequest) GetResourceId() string

func (*ChangePermissionLevelRequest) GetTeamName

func (m *ChangePermissionLevelRequest) GetTeamName() string

func (*ChangePermissionLevelRequest) ProtoMessage

func (*ChangePermissionLevelRequest) ProtoMessage()

func (*ChangePermissionLevelRequest) Reset

func (m *ChangePermissionLevelRequest) Reset()

func (*ChangePermissionLevelRequest) String

type ListReply

type ListReply struct {
	Resources []*ResourceEntry `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"`
}

func (*ListReply) Descriptor

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

func (*ListReply) GetResources

func (m *ListReply) GetResources() []*ResourceEntry

func (*ListReply) ProtoMessage

func (*ListReply) ProtoMessage()

func (*ListReply) Reset

func (m *ListReply) Reset()

func (*ListReply) String

func (m *ListReply) String() string

type ListRequest

type ListRequest struct {
}

func (*ListRequest) Descriptor

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

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

type RemoveFromTeamRequest

type RemoveFromTeamRequest struct {
	ResourceId       string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId" json:"resource_id,omitempty"`
	OrganizationName string `protobuf:"bytes,2,opt,name=organization_name,json=organizationName" json:"organization_name,omitempty"`
	TeamName         string `protobuf:"bytes,3,opt,name=team_name,json=teamName" json:"team_name,omitempty"`
}

func (*RemoveFromTeamRequest) Descriptor

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

func (*RemoveFromTeamRequest) GetOrganizationName

func (m *RemoveFromTeamRequest) GetOrganizationName() string

func (*RemoveFromTeamRequest) GetResourceId

func (m *RemoveFromTeamRequest) GetResourceId() string

func (*RemoveFromTeamRequest) GetTeamName

func (m *RemoveFromTeamRequest) GetTeamName() string

func (*RemoveFromTeamRequest) ProtoMessage

func (*RemoveFromTeamRequest) ProtoMessage()

func (*RemoveFromTeamRequest) Reset

func (m *RemoveFromTeamRequest) Reset()

func (*RemoveFromTeamRequest) String

func (m *RemoveFromTeamRequest) String() string

type ResourceClient

type ResourceClient interface {
	ResourceList(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error)
	ResourceAddToTeam(ctx context.Context, in *AddToTeamRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	ResourceChangePermissionLevel(ctx context.Context, in *ChangePermissionLevelRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	ResourceRemoveFromTeam(ctx context.Context, in *RemoveFromTeamRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}

func NewResourceClient

func NewResourceClient(cc *grpc.ClientConn) ResourceClient

type ResourceEntry

type ResourceEntry struct {
	Id    string            `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Type  ResourceType      `protobuf:"varint,2,opt,name=type,enum=resource.ResourceType" json:"type,omitempty"`
	Name  string            `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
	Owner *accounts.Account `protobuf:"bytes,4,opt,name=owner" json:"owner,omitempty"`
}

func (*ResourceEntry) Descriptor

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

func (*ResourceEntry) GetId

func (m *ResourceEntry) GetId() string

func (*ResourceEntry) GetName

func (m *ResourceEntry) GetName() string

func (*ResourceEntry) GetOwner

func (m *ResourceEntry) GetOwner() *accounts.Account

func (*ResourceEntry) GetType

func (m *ResourceEntry) GetType() ResourceType

func (*ResourceEntry) ProtoMessage

func (*ResourceEntry) ProtoMessage()

func (*ResourceEntry) Reset

func (m *ResourceEntry) Reset()

func (*ResourceEntry) String

func (m *ResourceEntry) String() string

type ResourceServer

type ResourceServer interface {
	ResourceList(context.Context, *ListRequest) (*ListReply, error)
	ResourceAddToTeam(context.Context, *AddToTeamRequest) (*google_protobuf.Empty, error)
	ResourceChangePermissionLevel(context.Context, *ChangePermissionLevelRequest) (*google_protobuf.Empty, error)
	ResourceRemoveFromTeam(context.Context, *RemoveFromTeamRequest) (*google_protobuf.Empty, error)
}

type ResourceType

type ResourceType int32
const (
	ResourceType_RESOURCE_STACK        ResourceType = 0
	ResourceType_RESOURCE_DASHBOARD    ResourceType = 1
	ResourceType_RESOURCE_USER         ResourceType = 2
	ResourceType_RESOURCE_ORGANIZATION ResourceType = 3
	ResourceType_RESOURCE_TEAM         ResourceType = 4
)

func (ResourceType) EnumDescriptor

func (ResourceType) EnumDescriptor() ([]byte, []int)

func (ResourceType) String

func (x ResourceType) String() string

type Server

type Server struct {
	Accounts   accounts.Interface
	Dashboards dashboards.Interface
	Stacks     stacks.Interface
}

Server is used to implement resource.ResourceServer

func (*Server) ResourceAddToTeam added in v0.17.0

func (s *Server) ResourceAddToTeam(ctx context.Context, in *AddToTeamRequest) (*empty.Empty, error)

AddToTeam implements resource.AddToTeam

func (*Server) ResourceChangePermissionLevel added in v0.17.0

func (s *Server) ResourceChangePermissionLevel(ctx context.Context, in *ChangePermissionLevelRequest) (*empty.Empty, error)

ChangePermissionLevel implements resource.ChangePermissionLevel

func (*Server) ResourceList added in v0.17.0

func (s *Server) ResourceList(ctx context.Context, in *ListRequest) (*ListReply, error)

List implements resource.List

func (*Server) ResourceRemoveFromTeam added in v0.17.0

func (s *Server) ResourceRemoveFromTeam(ctx context.Context, in *RemoveFromTeamRequest) (*empty.Empty, error)

RemoveFromTeam implements resource.RemoveFromTeam

Jump to

Keyboard shortcuts

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