zmqremote

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Overview

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

Package zmqremote is a generated protocol buffer package.

It is generated from these files:
	github.com/OnyxPay/OnyxChain-eventbus/zmqremote/protos.proto

It has these top-level messages:
	MessageBatch
	MessageEnvelope
	MessageHeader
	ActorPidRequest
	ActorPidResponse
	MsgData

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************

Index

Constants

This section is empty.

Variables

View Source
var (
	ActorPidRespErr         interface{} = &ActorPidResponse{StatusCode: ResponseStatusCodeERROR.ToInt32()}
	ActorPidRespTimeout     interface{} = &ActorPidResponse{StatusCode: ResponseStatusCodeTIMEOUT.ToInt32()}
	ActorPidRespUnavailable interface{} = &ActorPidResponse{StatusCode: ResponseStatusCodeUNAVAILABLE.ToInt32()}
)
View Source
var (
	ErrInvalidLengthProtos = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProtos   = fmt.Errorf("proto: integer overflow")
)
View Source
var DefaultSerializerID int32 = 0
View Source
var ErrActivatorUnavailable = &ActivatorError{ResponseStatusCodeUNAVAILABLE.ToInt32(), true}

ErrActivatorUnavailable : this error will not panic the Activator. It simply tells Partition this Activator is not available Partition will then find next available Activator to spawn

View Source
var MsgType_name = map[int32]string{
	0: "ADDRESS_MSG_TYPE",
	1: "BLOCK_MSG_TYPE",
	2: "HEADER_MSG_TYPE",
	3: "TX_MSG_TYPE",
	4: "TX_ATT_MSG_TYPE",
	5: "VM_CODE_MSG_TYPE",
}
View Source
var MsgType_value = map[string]int32{
	"ADDRESS_MSG_TYPE": 0,
	"BLOCK_MSG_TYPE":   1,
	"HEADER_MSG_TYPE":  2,
	"TX_MSG_TYPE":      3,
	"TX_ATT_MSG_TYPE":  4,
	"VM_CODE_MSG_TYPE": 5,
}

Functions

func ActivatorForAddress

func ActivatorForAddress(address string) *actor.PID

ActivatorForAddress returns a PID for the activator at the given address

func Deserialize

func Deserialize(message []byte, typeName string, serializerID int32) (interface{}, error)

func GetKnownKinds

func GetKnownKinds() []string

GetKnownKinds returns a slice of known actor "kinds"

func Register

func Register(kind string, props *actor.Props)

Register a known actor props by name

func RegisterSerializer

func RegisterSerializer(serializer Serializer)

func RegisterSerializerAsDefault

func RegisterSerializerAsDefault(serializer Serializer)

func SendMessage

func SendMessage(pid *actor.PID, header actor.ReadonlyMessageHeader, message interface{}, sender *actor.PID, serializerID int32)

func Serialize

func Serialize(message interface{}, serializerID int32) ([]byte, string, error)

func SetLogLevel

func SetLogLevel(level log.Level)

SetLogLevel sets the log level for the logger.

SetLogLevel is safe to call concurrently

func Shutdonw

func Shutdonw()

func SpawnFuture

func SpawnFuture(address, name, kind string, timeout time.Duration) *actor.Future

SpawnFuture spawns a remote actor and returns a Future that completes once the actor is started

func Start

func Start(address string)

Types

type ActivatorError

type ActivatorError struct {
	Code       int32
	DoNotPanic bool
}

func (*ActivatorError) Error

func (e *ActivatorError) Error() string

type ActorPidRequest

type ActorPidRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
}

func (*ActorPidRequest) Descriptor

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

func (*ActorPidRequest) Equal

func (this *ActorPidRequest) Equal(that interface{}) bool

func (*ActorPidRequest) GetKind

func (m *ActorPidRequest) GetKind() string

func (*ActorPidRequest) GetName

func (m *ActorPidRequest) GetName() string

func (*ActorPidRequest) Marshal

func (m *ActorPidRequest) Marshal() (dAtA []byte, err error)

func (*ActorPidRequest) MarshalTo

func (m *ActorPidRequest) MarshalTo(dAtA []byte) (int, error)

func (*ActorPidRequest) ProtoMessage

func (*ActorPidRequest) ProtoMessage()

func (*ActorPidRequest) Reset

func (m *ActorPidRequest) Reset()

func (*ActorPidRequest) Size

func (m *ActorPidRequest) Size() (n int)

func (*ActorPidRequest) String

func (this *ActorPidRequest) String() string

func (*ActorPidRequest) Unmarshal

func (m *ActorPidRequest) Unmarshal(dAtA []byte) error

type ActorPidResponse

type ActorPidResponse struct {
	Pid        *actor.PID `protobuf:"bytes,1,opt,name=pid" json:"pid,omitempty"`
	StatusCode int32      `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
}

func Spawn

func Spawn(address, kind string, timeout time.Duration) (*ActorPidResponse, error)

Spawn spawns a remote actor of a given type at a given address

func SpawnNamed

func SpawnNamed(address, name, kind string, timeout time.Duration) (*ActorPidResponse, error)

SpawnNamed spawns a named remote actor of a given type at a given address

func (*ActorPidResponse) Descriptor

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

func (*ActorPidResponse) Equal

func (this *ActorPidResponse) Equal(that interface{}) bool

func (*ActorPidResponse) GetPid

func (m *ActorPidResponse) GetPid() *actor.PID

func (*ActorPidResponse) GetStatusCode

func (m *ActorPidResponse) GetStatusCode() int32

func (*ActorPidResponse) Marshal

func (m *ActorPidResponse) Marshal() (dAtA []byte, err error)

func (*ActorPidResponse) MarshalTo

func (m *ActorPidResponse) MarshalTo(dAtA []byte) (int, error)

func (*ActorPidResponse) ProtoMessage

func (*ActorPidResponse) ProtoMessage()

func (*ActorPidResponse) Reset

func (m *ActorPidResponse) Reset()

func (*ActorPidResponse) Size

func (m *ActorPidResponse) Size() (n int)

func (*ActorPidResponse) String

func (this *ActorPidResponse) String() string

func (*ActorPidResponse) Unmarshal

func (m *ActorPidResponse) Unmarshal(dAtA []byte) error

type EndpointConnectedEvent

type EndpointConnectedEvent struct {
	Address string
}

type EndpointTerminatedEvent

type EndpointTerminatedEvent struct {
	Address string
}

type JsonMessage

type JsonMessage struct {
	TypeName string
	Json     string
}

type MessageBatch

type MessageBatch struct {
	TypeNames   []string           `protobuf:"bytes,1,rep,name=type_names,json=typeNames" json:"type_names,omitempty"`
	TargetNames []string           `protobuf:"bytes,2,rep,name=target_names,json=targetNames" json:"target_names,omitempty"`
	Envelopes   []*MessageEnvelope `protobuf:"bytes,3,rep,name=envelopes" json:"envelopes,omitempty"`
}

func (*MessageBatch) Descriptor

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

func (*MessageBatch) Equal

func (this *MessageBatch) Equal(that interface{}) bool

func (*MessageBatch) GetEnvelopes

func (m *MessageBatch) GetEnvelopes() []*MessageEnvelope

func (*MessageBatch) GetTargetNames

func (m *MessageBatch) GetTargetNames() []string

func (*MessageBatch) GetTypeNames

func (m *MessageBatch) GetTypeNames() []string

func (*MessageBatch) Marshal

func (m *MessageBatch) Marshal() (dAtA []byte, err error)

func (*MessageBatch) MarshalTo

func (m *MessageBatch) MarshalTo(dAtA []byte) (int, error)

func (*MessageBatch) ProtoMessage

func (*MessageBatch) ProtoMessage()

func (*MessageBatch) Reset

func (m *MessageBatch) Reset()

func (*MessageBatch) Size

func (m *MessageBatch) Size() (n int)

func (*MessageBatch) String

func (this *MessageBatch) String() string

func (*MessageBatch) Unmarshal

func (m *MessageBatch) Unmarshal(dAtA []byte) error

type MessageEnvelope

type MessageEnvelope struct {
	TypeId        int32          `protobuf:"varint,1,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"`
	MessageData   []byte         `protobuf:"bytes,2,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"`
	Target        int32          `protobuf:"varint,3,opt,name=target,proto3" json:"target,omitempty"`
	Sender        *actor.PID     `protobuf:"bytes,4,opt,name=sender" json:"sender,omitempty"`
	SerializerId  int32          `protobuf:"varint,5,opt,name=serializer_id,json=serializerId,proto3" json:"serializer_id,omitempty"`
	MessageHeader *MessageHeader `protobuf:"bytes,6,opt,name=message_header,json=messageHeader" json:"message_header,omitempty"`
}

func (*MessageEnvelope) Descriptor

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

func (*MessageEnvelope) Equal

func (this *MessageEnvelope) Equal(that interface{}) bool

func (*MessageEnvelope) GetMessageData

func (m *MessageEnvelope) GetMessageData() []byte

func (*MessageEnvelope) GetMessageHeader

func (m *MessageEnvelope) GetMessageHeader() *MessageHeader

func (*MessageEnvelope) GetSender

func (m *MessageEnvelope) GetSender() *actor.PID

func (*MessageEnvelope) GetSerializerId

func (m *MessageEnvelope) GetSerializerId() int32

func (*MessageEnvelope) GetTarget

func (m *MessageEnvelope) GetTarget() int32

func (*MessageEnvelope) GetTypeId

func (m *MessageEnvelope) GetTypeId() int32

func (*MessageEnvelope) Marshal

func (m *MessageEnvelope) Marshal() (dAtA []byte, err error)

func (*MessageEnvelope) MarshalTo

func (m *MessageEnvelope) MarshalTo(dAtA []byte) (int, error)

func (*MessageEnvelope) ProtoMessage

func (*MessageEnvelope) ProtoMessage()

func (*MessageEnvelope) Reset

func (m *MessageEnvelope) Reset()

func (*MessageEnvelope) Size

func (m *MessageEnvelope) Size() (n int)

func (*MessageEnvelope) String

func (this *MessageEnvelope) String() string

func (*MessageEnvelope) Unmarshal

func (m *MessageEnvelope) Unmarshal(dAtA []byte) error

type MessageHeader

type MessageHeader struct {
	HeaderData map[string]string `` /* 172-byte string literal not displayed */
}

func (*MessageHeader) Descriptor

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

func (*MessageHeader) Equal

func (this *MessageHeader) Equal(that interface{}) bool

func (*MessageHeader) GetHeaderData

func (m *MessageHeader) GetHeaderData() map[string]string

func (*MessageHeader) Marshal

func (m *MessageHeader) Marshal() (dAtA []byte, err error)

func (*MessageHeader) MarshalTo

func (m *MessageHeader) MarshalTo(dAtA []byte) (int, error)

func (*MessageHeader) ProtoMessage

func (*MessageHeader) ProtoMessage()

func (*MessageHeader) Reset

func (m *MessageHeader) Reset()

func (*MessageHeader) Size

func (m *MessageHeader) Size() (n int)

func (*MessageHeader) String

func (this *MessageHeader) String() string

func (*MessageHeader) Unmarshal

func (m *MessageHeader) Unmarshal(dAtA []byte) error

type MsgData

type MsgData struct {
	MsgType MsgType `protobuf:"varint,1,opt,name=msgType,proto3,enum=zmqremote.MsgType" json:"msgType,omitempty"`
	Data    []byte  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

func (*MsgData) Descriptor

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

func (*MsgData) Equal

func (this *MsgData) Equal(that interface{}) bool

func (*MsgData) GetData

func (m *MsgData) GetData() []byte

func (*MsgData) GetMsgType

func (m *MsgData) GetMsgType() MsgType

func (*MsgData) Marshal

func (m *MsgData) Marshal() (dAtA []byte, err error)

func (*MsgData) MarshalTo

func (m *MsgData) MarshalTo(dAtA []byte) (int, error)

func (*MsgData) ProtoMessage

func (*MsgData) ProtoMessage()

func (*MsgData) Reset

func (m *MsgData) Reset()

func (*MsgData) Size

func (m *MsgData) Size() (n int)

func (*MsgData) String

func (this *MsgData) String() string

func (*MsgData) Unmarshal

func (m *MsgData) Unmarshal(dAtA []byte) error

type MsgType

type MsgType int32
const (
	ADDRESS_MSG_TYPE MsgType = 0
	BLOCK_MSG_TYPE   MsgType = 1
	HEADER_MSG_TYPE  MsgType = 2
	TX_MSG_TYPE      MsgType = 3
	TX_ATT_MSG_TYPE  MsgType = 4
	VM_CODE_MSG_TYPE MsgType = 5
)

func (MsgType) EnumDescriptor

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

func (MsgType) String

func (x MsgType) String() string

type ResponseStatusCode

type ResponseStatusCode int32
const (
	ResponseStatusCodeOK ResponseStatusCode = iota
	ResponseStatusCodeUNAVAILABLE
	ResponseStatusCodeTIMEOUT
	ResponseStatusCodePROCESSNAMEALREADYEXIST
	ResponseStatusCodeERROR
)

func (ResponseStatusCode) ToInt32

func (c ResponseStatusCode) ToInt32() int32

type Serializer

type Serializer interface {
	Serialize(msg interface{}) ([]byte, error)
	Deserialize(typeName string, bytes []byte) (interface{}, error)
	GetTypeName(msg interface{}) (string, error)
}

Jump to

Keyboard shortcuts

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