core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package core is a generated protocol buffer package.

It is generated from these files:

github.com/mesg-foundation/core/api/core/api.proto

It has these top-level messages:

ListenEventRequest
EventData
ListenResultRequest
ResultData
ExecuteTaskRequest
ExecuteTaskReply
StartServiceRequest
StartServiceReply
StopServiceRequest
StopServiceReply
DeployServiceRequest
DeployServiceReply
DeleteServiceRequest
DeleteServiceReply
ListServicesRequest
ListServicesReply
GetServiceRequest
GetServiceReply

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCoreServer

func RegisterCoreServer(s *grpc.Server, srv CoreServer)

Types

type CoreClient

type CoreClient interface {
	// Subscribe to a stream that listens for events from a service.
	ListenEvent(ctx context.Context, in *ListenEventRequest, opts ...grpc.CallOption) (Core_ListenEventClient, error)
	// Subscribe to a stream that listens for task's result from a service.
	ListenResult(ctx context.Context, in *ListenResultRequest, opts ...grpc.CallOption) (Core_ListenResultClient, error)
	// Execute a service's task through [Core](../guide/start-here/core.md).
	ExecuteTask(ctx context.Context, in *ExecuteTaskRequest, opts ...grpc.CallOption) (*ExecuteTaskReply, error)
	// Start a service. The service must be already deployed to [Core](../guide/start-here/core.md).
	StartService(ctx context.Context, in *StartServiceRequest, opts ...grpc.CallOption) (*StartServiceReply, error)
	// Stop a service. The service must be already deployed to [Core](../guide/start-here/core.md).
	StopService(ctx context.Context, in *StopServiceRequest, opts ...grpc.CallOption) (*StopServiceReply, error)
	// Deploy a service to [Core](../guide/start-here/core.md). This will give you an unique identifier which is used to interact with the service.
	DeployService(ctx context.Context, in *DeployServiceRequest, opts ...grpc.CallOption) (*DeployServiceReply, error)
	// Delete a service from Core. This function only deletes a deployed service in [Core](../guide/start-here/core.md). If the service's code is on your computer, the source code will not be deleted.
	DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*DeleteServiceReply, error)
	// List all services already deployed in [Core](../guide/start-here/core.md).
	ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesReply, error)
	// Get the definition of an already-deployed service from its ID.
	GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceReply, error)
}

func NewCoreClient

func NewCoreClient(cc *grpc.ClientConn) CoreClient

type CoreServer

type CoreServer interface {
	// Subscribe to a stream that listens for events from a service.
	ListenEvent(*ListenEventRequest, Core_ListenEventServer) error
	// Subscribe to a stream that listens for task's result from a service.
	ListenResult(*ListenResultRequest, Core_ListenResultServer) error
	// Execute a service's task through [Core](../guide/start-here/core.md).
	ExecuteTask(context.Context, *ExecuteTaskRequest) (*ExecuteTaskReply, error)
	// Start a service. The service must be already deployed to [Core](../guide/start-here/core.md).
	StartService(context.Context, *StartServiceRequest) (*StartServiceReply, error)
	// Stop a service. The service must be already deployed to [Core](../guide/start-here/core.md).
	StopService(context.Context, *StopServiceRequest) (*StopServiceReply, error)
	// Deploy a service to [Core](../guide/start-here/core.md). This will give you an unique identifier which is used to interact with the service.
	DeployService(context.Context, *DeployServiceRequest) (*DeployServiceReply, error)
	// Delete a service from Core. This function only deletes a deployed service in [Core](../guide/start-here/core.md). If the service's code is on your computer, the source code will not be deleted.
	DeleteService(context.Context, *DeleteServiceRequest) (*DeleteServiceReply, error)
	// List all services already deployed in [Core](../guide/start-here/core.md).
	ListServices(context.Context, *ListServicesRequest) (*ListServicesReply, error)
	// Get the definition of an already-deployed service from its ID.
	GetService(context.Context, *GetServiceRequest) (*GetServiceReply, error)
}

type Core_ListenEventClient

type Core_ListenEventClient interface {
	Recv() (*EventData, error)
	grpc.ClientStream
}

type Core_ListenEventServer

type Core_ListenEventServer interface {
	Send(*EventData) error
	grpc.ServerStream
}

type Core_ListenResultClient

type Core_ListenResultClient interface {
	Recv() (*ResultData, error)
	grpc.ClientStream
}

type Core_ListenResultServer

type Core_ListenResultServer interface {
	Send(*ResultData) error
	grpc.ServerStream
}

type DeleteServiceReply

type DeleteServiceReply struct {
}

Reply of `DeleteService` API doesn't contain any data.

func (*DeleteServiceReply) Descriptor

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

func (*DeleteServiceReply) ProtoMessage

func (*DeleteServiceReply) ProtoMessage()

func (*DeleteServiceReply) Reset

func (m *DeleteServiceReply) Reset()

func (*DeleteServiceReply) String

func (m *DeleteServiceReply) String() string

type DeleteServiceRequest

type DeleteServiceRequest struct {
	ServiceID string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
}

Request's data of the `DeleteService` API.

**Example** ```json

{
  "serviceID": "__SERVICE_ID__"
}

```

func (*DeleteServiceRequest) Descriptor

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

func (*DeleteServiceRequest) GetServiceID

func (m *DeleteServiceRequest) GetServiceID() string

func (*DeleteServiceRequest) ProtoMessage

func (*DeleteServiceRequest) ProtoMessage()

func (*DeleteServiceRequest) Reset

func (m *DeleteServiceRequest) Reset()

func (*DeleteServiceRequest) String

func (m *DeleteServiceRequest) String() string

type DeployServiceReply

type DeployServiceReply struct {
	ServiceID string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
}

The reply's data of `DeployService` API.

**Example** ```json

{
  "serviceID": "__SERVICE_ID__"
}

```

func (*DeployServiceReply) Descriptor

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

func (*DeployServiceReply) GetServiceID

func (m *DeployServiceReply) GetServiceID() string

func (*DeployServiceReply) ProtoMessage

func (*DeployServiceReply) ProtoMessage()

func (*DeployServiceReply) Reset

func (m *DeployServiceReply) Reset()

func (*DeployServiceReply) String

func (m *DeployServiceReply) String() string

type DeployServiceRequest

type DeployServiceRequest struct {
	Service *service.Service `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}

The request's data for `DeployService` API.

**Example** ```json

{
  "service": {
    "name": "serviceX",
    "events": {
      "eventX": {
        "data": {
          "dataX": { "type": "String" }
        }
      }
    },
    "tasks": {
      "taskX": {
        "inputs": {
          "foo": { "type": "String" }
        },
        "outputs": {
          "outputX": {
            "data": {
              "resX": { "type": "String" }
            }
          }
        }
      }
    }
  }
}

```

func (*DeployServiceRequest) Descriptor

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

func (*DeployServiceRequest) GetService

func (m *DeployServiceRequest) GetService() *service.Service

func (*DeployServiceRequest) ProtoMessage

func (*DeployServiceRequest) ProtoMessage()

func (*DeployServiceRequest) Reset

func (m *DeployServiceRequest) Reset()

func (*DeployServiceRequest) String

func (m *DeployServiceRequest) String() string

type EventData

type EventData struct {
	EventKey  string `protobuf:"bytes,1,opt,name=eventKey" json:"eventKey,omitempty"`
	EventData string `protobuf:"bytes,2,opt,name=eventData" json:"eventData,omitempty"`
}

The data received from the stream of the `ListenEvent` API. The data will be received over time as long as the stream is open.

**Example** ```json

{
  "eventKey":  "__EVENT_KEY__",
  "eventData": "{\"foo\":\"bar\"}"
}

```

func (*EventData) Descriptor

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

func (*EventData) GetEventData

func (m *EventData) GetEventData() string

func (*EventData) GetEventKey

func (m *EventData) GetEventKey() string

func (*EventData) ProtoMessage

func (*EventData) ProtoMessage()

func (*EventData) Reset

func (m *EventData) Reset()

func (*EventData) String

func (m *EventData) String() string

type ExecuteTaskReply

type ExecuteTaskReply struct {
	ExecutionID string `protobuf:"bytes,1,opt,name=executionID" json:"executionID,omitempty"`
}

The reply's data of the `ExecuteTask` API.

**Example** ```json

{
  "executionID": "__EXECUTION_ID__"
}

```

func (*ExecuteTaskReply) Descriptor

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

func (*ExecuteTaskReply) GetExecutionID

func (m *ExecuteTaskReply) GetExecutionID() string

func (*ExecuteTaskReply) ProtoMessage

func (*ExecuteTaskReply) ProtoMessage()

func (*ExecuteTaskReply) Reset

func (m *ExecuteTaskReply) Reset()

func (*ExecuteTaskReply) String

func (m *ExecuteTaskReply) String() string

type ExecuteTaskRequest

type ExecuteTaskRequest struct {
	ServiceID     string   `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
	TaskKey       string   `protobuf:"bytes,2,opt,name=taskKey" json:"taskKey,omitempty"`
	InputData     string   `protobuf:"bytes,3,opt,name=inputData" json:"inputData,omitempty"`
	ExecutionTags []string `protobuf:"bytes,4,rep,name=executionTags" json:"executionTags,omitempty"`
}

The request's data for the `ExecuteTask` API.

**Example** ```json

{
  "serviceID":     "__SERVICE_ID__",
  "taskKey":       "__TASK_KEY__",
  "inputData":     "{\"foo\":\"bar\"}",
  "executionTags": ["executionX", "test"]
}

```

func (*ExecuteTaskRequest) Descriptor

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

func (*ExecuteTaskRequest) GetExecutionTags added in v0.2.0

func (m *ExecuteTaskRequest) GetExecutionTags() []string

func (*ExecuteTaskRequest) GetInputData

func (m *ExecuteTaskRequest) GetInputData() string

func (*ExecuteTaskRequest) GetServiceID

func (m *ExecuteTaskRequest) GetServiceID() string

func (*ExecuteTaskRequest) GetTaskKey

func (m *ExecuteTaskRequest) GetTaskKey() string

func (*ExecuteTaskRequest) ProtoMessage

func (*ExecuteTaskRequest) ProtoMessage()

func (*ExecuteTaskRequest) Reset

func (m *ExecuteTaskRequest) Reset()

func (*ExecuteTaskRequest) String

func (m *ExecuteTaskRequest) String() string

type GetServiceReply

type GetServiceReply struct {
	Service *service.Service `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}

The reply's data of the `GetService` API.

**Example** ```json

{
  "service": {
    "name": "serviceX",
    "events": {
      "eventX": {
        "data": {
          "dataX": { "type": "String" }
        }
      }
    },
    "tasks": {
      "taskX": {
        "inputs": {
          "foo": { "type": "String" }
        },
        "outputs": {
          "outputX": {
            "data": {
              "resX": { "type": "String" }
            }
          }
        }
      }
    }
  }
}

```

func (*GetServiceReply) Descriptor

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

func (*GetServiceReply) GetService

func (m *GetServiceReply) GetService() *service.Service

func (*GetServiceReply) ProtoMessage

func (*GetServiceReply) ProtoMessage()

func (*GetServiceReply) Reset

func (m *GetServiceReply) Reset()

func (*GetServiceReply) String

func (m *GetServiceReply) String() string

type GetServiceRequest

type GetServiceRequest struct {
	ServiceID string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
}

The request's data for the `GetService` API.

**Example** ```json

{
  "serviceID": "__SERVICE_ID__"
}

```

func (*GetServiceRequest) Descriptor

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

func (*GetServiceRequest) GetServiceID

func (m *GetServiceRequest) GetServiceID() string

func (*GetServiceRequest) ProtoMessage

func (*GetServiceRequest) ProtoMessage()

func (*GetServiceRequest) Reset

func (m *GetServiceRequest) Reset()

func (*GetServiceRequest) String

func (m *GetServiceRequest) String() string

type ListServicesReply

type ListServicesReply struct {
	Services []*service.Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"`
}

The reply's data of the `ListServices` API.

**Example** ```json

[{
  "service": {
    "name": "serviceX",
    "events": {
      "eventX": {
        "data": {
          "dataX": { "type": "String" }
        }
      }
    },
    "tasks": {
      "taskX": {
        "inputs": {
          "foo": { "type": "String" }
        },
        "outputs": {
          "outputX": {
            "data": {
              "resX": { "type": "String" }
            }
          }
        }
      }
    }
  }
}]

```

func (*ListServicesReply) Descriptor

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

func (*ListServicesReply) GetServices

func (m *ListServicesReply) GetServices() []*service.Service

func (*ListServicesReply) ProtoMessage

func (*ListServicesReply) ProtoMessage()

func (*ListServicesReply) Reset

func (m *ListServicesReply) Reset()

func (*ListServicesReply) String

func (m *ListServicesReply) String() string

type ListServicesRequest

type ListServicesRequest struct {
}

Reply of `ListServices` API doesn't contain any data.

func (*ListServicesRequest) Descriptor

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

func (*ListServicesRequest) ProtoMessage

func (*ListServicesRequest) ProtoMessage()

func (*ListServicesRequest) Reset

func (m *ListServicesRequest) Reset()

func (*ListServicesRequest) String

func (m *ListServicesRequest) String() string

type ListenEventRequest

type ListenEventRequest struct {
	ServiceID   string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
	EventFilter string `protobuf:"bytes,2,opt,name=eventFilter" json:"eventFilter,omitempty"`
}

The request's data for the `ListenEvent` stream's API.

**Example** ```json

{
  "serviceID":   "__SERVICE_ID__",
  "eventFilter": "__EVENT_KEY_TO_MATCH__"
}

```

func (*ListenEventRequest) Descriptor

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

func (*ListenEventRequest) GetEventFilter

func (m *ListenEventRequest) GetEventFilter() string

func (*ListenEventRequest) GetServiceID

func (m *ListenEventRequest) GetServiceID() string

func (*ListenEventRequest) ProtoMessage

func (*ListenEventRequest) ProtoMessage()

func (*ListenEventRequest) Reset

func (m *ListenEventRequest) Reset()

func (*ListenEventRequest) String

func (m *ListenEventRequest) String() string

type ListenResultRequest

type ListenResultRequest struct {
	ServiceID    string   `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
	TaskFilter   string   `protobuf:"bytes,2,opt,name=taskFilter" json:"taskFilter,omitempty"`
	OutputFilter string   `protobuf:"bytes,3,opt,name=outputFilter" json:"outputFilter,omitempty"`
	TagFilters   []string `protobuf:"bytes,4,rep,name=tagFilters" json:"tagFilters,omitempty"`
}

The request's data for the `ListenResult` stream API.

**Example** ```json

{
  "serviceID":     "__SERVICE_ID__",
  "taskFilter":    "__TASK_KEY_TO_MATCH__",
  "outputFilter":  "__OUTPUT_KEY_TO_MATCH__",
  "tagFilters":     ["tagX"]
}

```

func (*ListenResultRequest) Descriptor

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

func (*ListenResultRequest) GetOutputFilter

func (m *ListenResultRequest) GetOutputFilter() string

func (*ListenResultRequest) GetServiceID

func (m *ListenResultRequest) GetServiceID() string

func (*ListenResultRequest) GetTagFilters added in v0.2.0

func (m *ListenResultRequest) GetTagFilters() []string

func (*ListenResultRequest) GetTaskFilter

func (m *ListenResultRequest) GetTaskFilter() string

func (*ListenResultRequest) ProtoMessage

func (*ListenResultRequest) ProtoMessage()

func (*ListenResultRequest) Reset

func (m *ListenResultRequest) Reset()

func (*ListenResultRequest) String

func (m *ListenResultRequest) String() string

type NotRunningServiceError added in v0.2.0

type NotRunningServiceError struct {
	ServiceID string
}

NotRunningServiceError is an error when a service is not running.

func (*NotRunningServiceError) Error added in v0.2.0

func (e *NotRunningServiceError) Error() string

type ResultData

type ResultData struct {
	ExecutionID   string   `protobuf:"bytes,1,opt,name=executionID" json:"executionID,omitempty"`
	TaskKey       string   `protobuf:"bytes,2,opt,name=taskKey" json:"taskKey,omitempty"`
	OutputKey     string   `protobuf:"bytes,3,opt,name=outputKey" json:"outputKey,omitempty"`
	OutputData    string   `protobuf:"bytes,4,opt,name=outputData" json:"outputData,omitempty"`
	ExecutionTags []string `protobuf:"bytes,5,rep,name=executionTags" json:"executionTags,omitempty"`
}

The data received from the stream of the `ListenResult` API. The data will be received over time as long as the stream is open.

**Example** ```json

{
  "executionID":   "__EXECUTION_ID__",
  "taskKey":       "__TASK_KEY__",
  "outputKey":     "__OUTPUT_KEY__",
  "outputData":    "{\"foo\":\"bar\"}",
  "executionTags": ["executionX", "test"]
}

```

func (*ResultData) Descriptor

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

func (*ResultData) GetExecutionID

func (m *ResultData) GetExecutionID() string

func (*ResultData) GetExecutionTags added in v0.2.0

func (m *ResultData) GetExecutionTags() []string

func (*ResultData) GetOutputData

func (m *ResultData) GetOutputData() string

func (*ResultData) GetOutputKey

func (m *ResultData) GetOutputKey() string

func (*ResultData) GetTaskKey

func (m *ResultData) GetTaskKey() string

func (*ResultData) ProtoMessage

func (*ResultData) ProtoMessage()

func (*ResultData) Reset

func (m *ResultData) Reset()

func (*ResultData) String

func (m *ResultData) String() string

type Server

type Server struct{}

Server is the type to aggregate all the APIs.

func (*Server) DeleteService

func (s *Server) DeleteService(ctx context.Context, request *DeleteServiceRequest) (*DeleteServiceReply, error)

DeleteService deletes a service in the database and eventually stops the docker of this service.

func (*Server) DeployService

func (s *Server) DeployService(ctx context.Context, request *DeployServiceRequest) (*DeployServiceReply, error)

DeployService saves a service in the database and returns the hash of this service.

func (*Server) ExecuteTask

func (s *Server) ExecuteTask(ctx context.Context, request *ExecuteTaskRequest) (*ExecuteTaskReply, error)

ExecuteTask executes a task for a given service.

func (*Server) GetService

func (s *Server) GetService(ctx context.Context, request *GetServiceRequest) (*GetServiceReply, error)

GetService fetches a service from the database and returns it.

func (*Server) ListServices

func (s *Server) ListServices(ctx context.Context, request *ListServicesRequest) (*ListServicesReply, error)

ListServices returns all services from the database.

func (*Server) ListenEvent

func (s *Server) ListenEvent(request *ListenEventRequest, stream Core_ListenEventServer) error

ListenEvent listens for an event from a specific service.

func (*Server) ListenResult

func (s *Server) ListenResult(request *ListenResultRequest, stream Core_ListenResultServer) error

ListenResult listens for results from a services.

func (*Server) StartService

func (s *Server) StartService(ctx context.Context, request *StartServiceRequest) (*StartServiceReply, error)

StartService fetches a service from the database and starts it.

func (*Server) StopService

func (s *Server) StopService(ctx context.Context, request *StopServiceRequest) (*StopServiceReply, error)

StopService fetches a service from the database and stops it.

type StartServiceReply

type StartServiceReply struct {
}

Reply of `StartService` API doesn't contain any data.

func (*StartServiceReply) Descriptor

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

func (*StartServiceReply) ProtoMessage

func (*StartServiceReply) ProtoMessage()

func (*StartServiceReply) Reset

func (m *StartServiceReply) Reset()

func (*StartServiceReply) String

func (m *StartServiceReply) String() string

type StartServiceRequest

type StartServiceRequest struct {
	ServiceID string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
}

The request's data for the `StartService` API.

**Example** ```json

{
  "serviceID": "__SERVICE_ID__"
}

```

func (*StartServiceRequest) Descriptor

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

func (*StartServiceRequest) GetServiceID

func (m *StartServiceRequest) GetServiceID() string

func (*StartServiceRequest) ProtoMessage

func (*StartServiceRequest) ProtoMessage()

func (*StartServiceRequest) Reset

func (m *StartServiceRequest) Reset()

func (*StartServiceRequest) String

func (m *StartServiceRequest) String() string

type StopServiceReply

type StopServiceReply struct {
}

Reply of `StopService` API doesn't contain any data.

func (*StopServiceReply) Descriptor

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

func (*StopServiceReply) ProtoMessage

func (*StopServiceReply) ProtoMessage()

func (*StopServiceReply) Reset

func (m *StopServiceReply) Reset()

func (*StopServiceReply) String

func (m *StopServiceReply) String() string

type StopServiceRequest

type StopServiceRequest struct {
	ServiceID string `protobuf:"bytes,1,opt,name=serviceID" json:"serviceID,omitempty"`
}

The request's data for the `StopService` API.

**Example** ```json

{
  "serviceID": "__SERVICE_ID__"
}

```

func (*StopServiceRequest) Descriptor

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

func (*StopServiceRequest) GetServiceID

func (m *StopServiceRequest) GetServiceID() string

func (*StopServiceRequest) ProtoMessage

func (*StopServiceRequest) ProtoMessage()

func (*StopServiceRequest) Reset

func (m *StopServiceRequest) Reset()

func (*StopServiceRequest) String

func (m *StopServiceRequest) String() string

Jump to

Keyboard shortcuts

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