Documentation ¶
Overview ¶
Package service is a generated protocol buffer package.
It is generated from these files:
github.com/appcelerator/amp/api/rpc/service/service.proto
It has these top-level messages:
PsRequest Task PsReply ListRequest ListReply ServiceEntry InspectRequest InspectReply ScaleRequest
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error
- func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
- type InspectReply
- type InspectRequest
- type ListReply
- type ListRequest
- type PsReply
- type PsRequest
- type ScaleRequest
- type Server
- func (s *Server) ServiceInspect(ctx context.Context, in *InspectRequest) (*InspectReply, error)
- func (s *Server) ServiceList(ctx context.Context, in *ListRequest) (*ListReply, error)
- func (s *Server) ServicePs(ctx context.Context, in *PsRequest) (*PsReply, error)
- func (s *Server) ServiceScale(ctx context.Context, in *ScaleRequest) (*empty.Empty, error)
- type ServiceClient
- type ServiceEntry
- func (*ServiceEntry) Descriptor() ([]byte, []int)
- func (m *ServiceEntry) GetId() string
- func (m *ServiceEntry) GetImage() string
- func (m *ServiceEntry) GetMode() string
- func (m *ServiceEntry) GetName() string
- func (m *ServiceEntry) GetRunningTasks() int32
- func (m *ServiceEntry) GetStatus() string
- func (m *ServiceEntry) GetTag() string
- func (m *ServiceEntry) GetTotalTasks() int32
- func (*ServiceEntry) ProtoMessage()
- func (m *ServiceEntry) Reset()
- func (m *ServiceEntry) String() string
- type ServiceServer
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (m *Task) GetCurrentState() string
- func (m *Task) GetDesiredState() string
- func (m *Task) GetError() string
- func (m *Task) GetId() string
- func (m *Task) GetImage() string
- func (m *Task) GetName() string
- func (m *Task) GetNodeId() string
- func (m *Task) GetSlot() int32
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) String() string
Constants ¶
const ( RoleLabel = "io.amp.role" LatestTag = "latest" GlobalMode = "global" ReplicatedMode = "replicated" StackNameLabelName = "com.docker.stack.namespace" )
Service constants
Variables ¶
This section is empty.
Functions ¶
func RegisterServiceHandler ¶ added in v0.4.0
func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterServiceHandler registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterServiceHandlerClient ¶ added in v0.16.0
func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error
RegisterServiceHandler registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServiceClient" to call the correct interceptors.
func RegisterServiceHandlerFromEndpoint ¶ added in v0.4.0
func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterServiceServer ¶
func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
Types ¶
type InspectReply ¶ added in v0.16.0
type InspectReply struct {
Json string `protobuf:"bytes,1,opt,name=json" json:"json,omitempty"`
}
func (*InspectReply) Descriptor ¶ added in v0.16.0
func (*InspectReply) Descriptor() ([]byte, []int)
func (*InspectReply) GetJson ¶ added in v0.16.0
func (m *InspectReply) GetJson() string
func (*InspectReply) ProtoMessage ¶ added in v0.16.0
func (*InspectReply) ProtoMessage()
func (*InspectReply) Reset ¶ added in v0.16.0
func (m *InspectReply) Reset()
func (*InspectReply) String ¶ added in v0.16.0
func (m *InspectReply) String() string
type InspectRequest ¶ added in v0.16.0
type InspectRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}
func (*InspectRequest) Descriptor ¶ added in v0.16.0
func (*InspectRequest) Descriptor() ([]byte, []int)
func (*InspectRequest) GetService ¶ added in v0.16.0
func (m *InspectRequest) GetService() string
func (*InspectRequest) ProtoMessage ¶ added in v0.16.0
func (*InspectRequest) ProtoMessage()
func (*InspectRequest) Reset ¶ added in v0.16.0
func (m *InspectRequest) Reset()
func (*InspectRequest) String ¶ added in v0.16.0
func (m *InspectRequest) String() string
type ListReply ¶ added in v0.16.0
type ListReply struct {
Entries []*ServiceEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"`
}
func (*ListReply) Descriptor ¶ added in v0.16.0
func (*ListReply) GetEntries ¶ added in v0.16.0
func (m *ListReply) GetEntries() []*ServiceEntry
func (*ListReply) ProtoMessage ¶ added in v0.16.0
func (*ListReply) ProtoMessage()
type ListRequest ¶ added in v0.16.0
type ListRequest struct {
Stack string `protobuf:"bytes,1,opt,name=stack" json:"stack,omitempty"`
}
func (*ListRequest) Descriptor ¶ added in v0.16.0
func (*ListRequest) Descriptor() ([]byte, []int)
func (*ListRequest) GetStack ¶ added in v0.16.0
func (m *ListRequest) GetStack() string
func (*ListRequest) ProtoMessage ¶ added in v0.16.0
func (*ListRequest) ProtoMessage()
func (*ListRequest) Reset ¶ added in v0.16.0
func (m *ListRequest) Reset()
func (*ListRequest) String ¶ added in v0.16.0
func (m *ListRequest) String() string
type PsReply ¶ added in v0.16.0
type PsReply struct {
Tasks []*Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"`
}
func (*PsReply) Descriptor ¶ added in v0.16.0
func (*PsReply) ProtoMessage ¶ added in v0.16.0
func (*PsReply) ProtoMessage()
type PsRequest ¶ added in v0.16.0
type PsRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}
func (*PsRequest) Descriptor ¶ added in v0.16.0
func (*PsRequest) GetService ¶ added in v0.16.0
func (*PsRequest) ProtoMessage ¶ added in v0.16.0
func (*PsRequest) ProtoMessage()
type ScaleRequest ¶ added in v0.16.0
type ScaleRequest struct { Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` Replicas uint64 `protobuf:"varint,2,opt,name=replicas" json:"replicas,omitempty"` }
func (*ScaleRequest) Descriptor ¶ added in v0.16.0
func (*ScaleRequest) Descriptor() ([]byte, []int)
func (*ScaleRequest) GetReplicas ¶ added in v0.16.0
func (m *ScaleRequest) GetReplicas() uint64
func (*ScaleRequest) GetService ¶ added in v0.16.0
func (m *ScaleRequest) GetService() string
func (*ScaleRequest) ProtoMessage ¶ added in v0.16.0
func (*ScaleRequest) ProtoMessage()
func (*ScaleRequest) Reset ¶ added in v0.16.0
func (m *ScaleRequest) Reset()
func (*ScaleRequest) String ¶ added in v0.16.0
func (m *ScaleRequest) String() string
type Server ¶ added in v0.10.0
Server is used to implement ServiceServer
func (*Server) ServiceInspect ¶ added in v0.17.0
func (s *Server) ServiceInspect(ctx context.Context, in *InspectRequest) (*InspectReply, error)
Inspect inspects a service
func (*Server) ServiceList ¶ added in v0.17.0
List implements service.List
func (*Server) ServiceScale ¶ added in v0.17.0
Scale scales a service
type ServiceClient ¶
type ServiceClient interface { ServicePs(ctx context.Context, in *PsRequest, opts ...grpc.CallOption) (*PsReply, error) ServiceList(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error) ServiceInspect(ctx context.Context, in *InspectRequest, opts ...grpc.CallOption) (*InspectReply, error) ServiceScale(ctx context.Context, in *ScaleRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) }
func NewServiceClient ¶
func NewServiceClient(cc *grpc.ClientConn) ServiceClient
type ServiceEntry ¶ added in v0.16.0
type ServiceEntry struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` Mode string `protobuf:"bytes,3,opt,name=mode" json:"mode,omitempty"` Image string `protobuf:"bytes,4,opt,name=image" json:"image,omitempty"` Tag string `protobuf:"bytes,5,opt,name=tag" json:"tag,omitempty"` RunningTasks int32 `protobuf:"varint,6,opt,name=running_tasks,json=runningTasks" json:"running_tasks,omitempty"` TotalTasks int32 `protobuf:"varint,7,opt,name=total_tasks,json=totalTasks" json:"total_tasks,omitempty"` Status string `protobuf:"bytes,8,opt,name=status" json:"status,omitempty"` }
func (*ServiceEntry) Descriptor ¶ added in v0.16.0
func (*ServiceEntry) Descriptor() ([]byte, []int)
func (*ServiceEntry) GetId ¶ added in v0.16.0
func (m *ServiceEntry) GetId() string
func (*ServiceEntry) GetImage ¶ added in v0.16.0
func (m *ServiceEntry) GetImage() string
func (*ServiceEntry) GetMode ¶ added in v0.16.0
func (m *ServiceEntry) GetMode() string
func (*ServiceEntry) GetName ¶ added in v0.16.0
func (m *ServiceEntry) GetName() string
func (*ServiceEntry) GetRunningTasks ¶ added in v0.16.0
func (m *ServiceEntry) GetRunningTasks() int32
func (*ServiceEntry) GetStatus ¶ added in v0.16.0
func (m *ServiceEntry) GetStatus() string
func (*ServiceEntry) GetTag ¶ added in v0.16.0
func (m *ServiceEntry) GetTag() string
func (*ServiceEntry) GetTotalTasks ¶ added in v0.16.0
func (m *ServiceEntry) GetTotalTasks() int32
func (*ServiceEntry) ProtoMessage ¶ added in v0.16.0
func (*ServiceEntry) ProtoMessage()
func (*ServiceEntry) Reset ¶ added in v0.16.0
func (m *ServiceEntry) Reset()
func (*ServiceEntry) String ¶ added in v0.16.0
func (m *ServiceEntry) String() string
type ServiceServer ¶
type ServiceServer interface { ServicePs(context.Context, *PsRequest) (*PsReply, error) ServiceList(context.Context, *ListRequest) (*ListReply, error) ServiceInspect(context.Context, *InspectRequest) (*InspectReply, error) ServiceScale(context.Context, *ScaleRequest) (*google_protobuf1.Empty, error) }
type Task ¶ added in v0.10.0
type Task struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Image string `protobuf:"bytes,2,opt,name=image" json:"image,omitempty"` CurrentState string `protobuf:"bytes,3,opt,name=current_state,json=currentState" json:"current_state,omitempty"` DesiredState string `protobuf:"bytes,4,opt,name=desired_state,json=desiredState" json:"desired_state,omitempty"` NodeId string `protobuf:"bytes,5,opt,name=node_id,json=nodeId" json:"node_id,omitempty"` Error string `protobuf:"bytes,6,opt,name=error" json:"error,omitempty"` Name string `protobuf:"bytes,7,opt,name=name" json:"name,omitempty"` Slot int32 `protobuf:"varint,8,opt,name=slot" json:"slot,omitempty"` }
func (*Task) Descriptor ¶ added in v0.10.0
func (*Task) GetCurrentState ¶ added in v0.12.0
func (*Task) GetDesiredState ¶ added in v0.10.0
func (*Task) ProtoMessage ¶ added in v0.10.0
func (*Task) ProtoMessage()