events

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABApiAgreementCancelationMessage

type ABApiAgreementCancelationMessage struct {
	AgreementProtocol string
	AgreementId       string
	// contains filtered or unexported fields
}

Agbot Api messages

func NewABApiAgreementCancelationMessage

func NewABApiAgreementCancelationMessage(id EventId, protocol string, agreementId string) *ABApiAgreementCancelationMessage

func (*ABApiAgreementCancelationMessage) Event

func (ABApiAgreementCancelationMessage) ShortString

func (m ABApiAgreementCancelationMessage) ShortString() string

func (ABApiAgreementCancelationMessage) String

type ABApiWorkloadUpgradeMessage

type ABApiWorkloadUpgradeMessage struct {
	AgreementProtocol string
	AgreementId       string
	DeviceId          string
	PolicyName        string
	// contains filtered or unexported fields
}

func NewABApiWorkloadUpgradeMessage

func NewABApiWorkloadUpgradeMessage(id EventId, protocol string, agreementId string, deviceId string, policyName string) *ABApiWorkloadUpgradeMessage

func (*ABApiWorkloadUpgradeMessage) Event

func (ABApiWorkloadUpgradeMessage) ShortString

func (m ABApiWorkloadUpgradeMessage) ShortString() string

func (ABApiWorkloadUpgradeMessage) String

type AccountFundedMessage

type AccountFundedMessage struct {
	Account string
	Time    uint64
	// contains filtered or unexported fields
}

Account funded message

func NewAccountFundedMessage

func NewAccountFundedMessage(id EventId, acct string, bcType string, bcName string, bcOrg string, serviceName string, servicePort string, colonusDir string) *AccountFundedMessage

func (AccountFundedMessage) BlockchainInstance

func (m AccountFundedMessage) BlockchainInstance() string

func (AccountFundedMessage) BlockchainOrg

func (m AccountFundedMessage) BlockchainOrg() string

func (AccountFundedMessage) BlockchainType

func (m AccountFundedMessage) BlockchainType() string

func (AccountFundedMessage) ColonusDir

func (m AccountFundedMessage) ColonusDir() string

func (*AccountFundedMessage) Event

func (m *AccountFundedMessage) Event() Event

func (AccountFundedMessage) ServiceName

func (m AccountFundedMessage) ServiceName() string

func (AccountFundedMessage) ServicePort

func (m AccountFundedMessage) ServicePort() string

func (AccountFundedMessage) ShortString

func (m AccountFundedMessage) ShortString() string

func (AccountFundedMessage) String

func (m AccountFundedMessage) String() string

type AgreementLaunchContext

type AgreementLaunchContext struct {
	AgreementProtocol    string
	AgreementId          string
	Configure            ContainerConfig
	ConfigureRaw         []byte
	EnvironmentAdditions *map[string]string // provided by platform, not but user
	Microservices        []MicroserviceSpec // for ms split.
}

func (AgreementLaunchContext) ContainerConfig

func (c AgreementLaunchContext) ContainerConfig() ContainerConfig

func (AgreementLaunchContext) ShortString

func (c AgreementLaunchContext) ShortString() string

func (AgreementLaunchContext) String

func (c AgreementLaunchContext) String() string

type AgreementReachedMessage

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

Anax device side fires this event when an agreement is reached so that it can begin downloading containers. The Agreement is not final until it is seen in the blockchain.

func (*AgreementReachedMessage) Event

func (e *AgreementReachedMessage) Event() Event

func (*AgreementReachedMessage) LaunchContext

func (e *AgreementReachedMessage) LaunchContext() *AgreementLaunchContext

func (AgreementReachedMessage) ShortString

func (e AgreementReachedMessage) ShortString() string

func (AgreementReachedMessage) String

func (e AgreementReachedMessage) String() string

type AllBlockchainShutdownMessage

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

func NewAllBlockchainShutdownMessage

func NewAllBlockchainShutdownMessage(id EventId) *AllBlockchainShutdownMessage

func (*AllBlockchainShutdownMessage) Event

func (*AllBlockchainShutdownMessage) ShortString

func (w *AllBlockchainShutdownMessage) ShortString() string

func (*AllBlockchainShutdownMessage) String

type ApiAgreementCancelationMessage

type ApiAgreementCancelationMessage struct {
	AgreementProtocol string
	AgreementId       string
	Deployment        persistence.DeploymentConfig
	Cause             EndContractCause
	// contains filtered or unexported fields
}

Api messages

func NewApiAgreementCancelationMessage

func NewApiAgreementCancelationMessage(id EventId, cause EndContractCause, protocol string, agreementId string, deployment persistence.DeploymentConfig) *ApiAgreementCancelationMessage

func (*ApiAgreementCancelationMessage) Event

func (ApiAgreementCancelationMessage) ShortString

func (m ApiAgreementCancelationMessage) ShortString() string

func (ApiAgreementCancelationMessage) String

type BlockchainClientInitializedMessage

type BlockchainClientInitializedMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Blockchain client initialized message

func NewBlockchainClientInitializedMessage

func NewBlockchainClientInitializedMessage(id EventId, bcType string, bcName string, bcOrg string, serviceName string, servicePort string, colonusDir string) *BlockchainClientInitializedMessage

func (BlockchainClientInitializedMessage) BlockchainInstance

func (m BlockchainClientInitializedMessage) BlockchainInstance() string

func (BlockchainClientInitializedMessage) BlockchainOrg

func (m BlockchainClientInitializedMessage) BlockchainOrg() string

func (BlockchainClientInitializedMessage) BlockchainType

func (m BlockchainClientInitializedMessage) BlockchainType() string

func (BlockchainClientInitializedMessage) ColonusDir

func (*BlockchainClientInitializedMessage) Event

func (BlockchainClientInitializedMessage) ServiceName

func (BlockchainClientInitializedMessage) ServicePort

func (BlockchainClientInitializedMessage) ShortString

func (BlockchainClientInitializedMessage) String

type BlockchainClientStoppingMessage

type BlockchainClientStoppingMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Blockchain client Stopping message

func NewBlockchainClientStoppingMessage

func NewBlockchainClientStoppingMessage(id EventId, bcType string, bcName string, org string) *BlockchainClientStoppingMessage

func (BlockchainClientStoppingMessage) BlockchainInstance

func (m BlockchainClientStoppingMessage) BlockchainInstance() string

func (BlockchainClientStoppingMessage) BlockchainOrg

func (m BlockchainClientStoppingMessage) BlockchainOrg() string

func (BlockchainClientStoppingMessage) BlockchainType

func (m BlockchainClientStoppingMessage) BlockchainType() string

func (*BlockchainClientStoppingMessage) Event

func (BlockchainClientStoppingMessage) ShortString

func (m BlockchainClientStoppingMessage) ShortString() string

func (BlockchainClientStoppingMessage) String

type BlockchainConfig

type BlockchainConfig struct {
	Type string
	Name string
	Org  string
}

type CacheServicePolicyMessage

type CacheServicePolicyMessage struct {
	BusinessPolOrg  string
	BusinessPolName string
	ServiceId       string
	ServicePolicy   string
	// contains filtered or unexported fields
}

This event indicates that the business policy manager should cache the given service policy

func NewCacheServicePolicyMessage

func NewCacheServicePolicyMessage(id EventId, bPolOrg, bPolName, svcId string, svcPolicy string) *CacheServicePolicyMessage

func (*CacheServicePolicyMessage) Event

func (e *CacheServicePolicyMessage) Event() Event

func (CacheServicePolicyMessage) ShortString

func (e CacheServicePolicyMessage) ShortString() string

func (CacheServicePolicyMessage) String

func (e CacheServicePolicyMessage) String() string

type ContainerConfig

type ContainerConfig struct {
	Deployment          string            `json:"deployment"`           // A stringified (and escaped) JSON structure.
	DeploymentSignature string            `json:"deployment_signature"` // Digital signature of the Deployment string.
	DeploymentUserInfo  string            `json:"deployment_user_info"`
	Overrides           string            `json:"overrides"`
	ImageDockerAuths    []ImageDockerAuth `json:"image_auths"`
}

func NewContainerConfig

func NewContainerConfig(deployment string, deploymentSignature string, deploymentUserInfo string, overrides string, imageDockerAuths []ImageDockerAuth) *ContainerConfig

func (ContainerConfig) String

func (c ContainerConfig) String() string

type ContainerLaunchContext

type ContainerLaunchContext struct {
	Configure            ContainerConfig
	EnvironmentAdditions *map[string]string
	Blockchain           BlockchainConfig
	Name                 string // used as the docker network name and part of container name. For microservice it is the ms instance key
	AgreementIds         []string
	Microservices        []MicroserviceSpec                     // Service dependencies go here. Microservices (in the workload/microservice model) never have dependencies.
	ServicePathElement   persistence.ServiceInstancePathElement // The service that we're trying to start.
	IsRetry              bool
}

func NewContainerLaunchContext

func NewContainerLaunchContext(config *ContainerConfig, envAdds *map[string]string, bc BlockchainConfig, name string, agIds []string, mss []MicroserviceSpec, spe *persistence.ServiceInstancePathElement, isRetry bool) *ContainerLaunchContext

func (ContainerLaunchContext) ContainerConfig

func (c ContainerLaunchContext) ContainerConfig() ContainerConfig

func (ContainerLaunchContext) GetAgreementIds

func (c ContainerLaunchContext) GetAgreementIds() []string

func (ContainerLaunchContext) GetMicroservices

func (c ContainerLaunchContext) GetMicroservices() []MicroserviceSpec

func (ContainerLaunchContext) GetServicePathElement

func (ContainerLaunchContext) ShortString

func (c ContainerLaunchContext) ShortString() string

func (ContainerLaunchContext) String

func (c ContainerLaunchContext) String() string

type ContainerMessage

type ContainerMessage struct {
	LaunchContext ContainerLaunchContext
	ServiceName   string
	ServicePort   string
	// contains filtered or unexported fields
}

Container messages

func NewContainerMessage

func NewContainerMessage(id EventId, lc ContainerLaunchContext, serviceName string, servicePort string) *ContainerMessage

func (ContainerMessage) Event

func (b ContainerMessage) Event() Event

func (ContainerMessage) ShortString

func (m ContainerMessage) ShortString() string

func (ContainerMessage) String

func (m ContainerMessage) String() string

type ContainerShutdownMessage

type ContainerShutdownMessage struct {
	ContainerName string
	Org           string
	// contains filtered or unexported fields
}

Container Shutdown message

func NewContainerShutdownMessage

func NewContainerShutdownMessage(id EventId, containerName string, org string) *ContainerShutdownMessage

func (ContainerShutdownMessage) Event

func (b ContainerShutdownMessage) Event() Event

func (ContainerShutdownMessage) ShortString

func (m ContainerShutdownMessage) ShortString() string

func (ContainerShutdownMessage) String

func (m ContainerShutdownMessage) String() string

type ContainerStopMessage

type ContainerStopMessage struct {
	ContainerName string
	Org           string
	// contains filtered or unexported fields
}

Container stop message

func NewContainerStopMessage

func NewContainerStopMessage(id EventId, containerName string, org string) *ContainerStopMessage

func (ContainerStopMessage) Event

func (b ContainerStopMessage) Event() Event

func (ContainerStopMessage) ShortString

func (m ContainerStopMessage) ShortString() string

func (ContainerStopMessage) String

func (m ContainerStopMessage) String() string

type CustomEventRecorder

type CustomEventRecorder func(e Message)

type CustomReceivedEvent

type CustomReceivedEvent func(e Message) bool

type DeviceAgreementsSyncedMessage

type DeviceAgreementsSyncedMessage struct {
	Completed bool
	Time      uint64
	// contains filtered or unexported fields
}

Tell everyone that the device side of anax has synced up it's agreements wiht the exchange and blockchain

func NewDeviceAgreementsSyncedMessage

func NewDeviceAgreementsSyncedMessage(id EventId, completed bool) *DeviceAgreementsSyncedMessage

func (*DeviceAgreementsSyncedMessage) Event

func (*DeviceAgreementsSyncedMessage) IsCompleted

func (m *DeviceAgreementsSyncedMessage) IsCompleted() bool

func (DeviceAgreementsSyncedMessage) ShortString

func (m DeviceAgreementsSyncedMessage) ShortString() string

func (DeviceAgreementsSyncedMessage) String

type DeviceContainersSyncedMessage

type DeviceContainersSyncedMessage struct {
	Completed bool
	Time      uint64
	// contains filtered or unexported fields
}

Tell everyone that the device side of anax has synced up it's containers with the local DB

func NewDeviceContainersSyncedMessage

func NewDeviceContainersSyncedMessage(id EventId, completed bool) *DeviceContainersSyncedMessage

func (*DeviceContainersSyncedMessage) Event

func (*DeviceContainersSyncedMessage) IsCompleted

func (m *DeviceContainersSyncedMessage) IsCompleted() bool

func (DeviceContainersSyncedMessage) ShortString

func (m DeviceContainersSyncedMessage) ShortString() string

func (DeviceContainersSyncedMessage) String

type EdgeConfigCompleteMessage

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

This event indicates that the edge device configuration is complete

func NewEdgeConfigCompleteMessage

func NewEdgeConfigCompleteMessage(evId EventId) *EdgeConfigCompleteMessage

func (*EdgeConfigCompleteMessage) Event

func (e *EdgeConfigCompleteMessage) Event() Event

func (EdgeConfigCompleteMessage) ShortString

func (e EdgeConfigCompleteMessage) ShortString() string

func (EdgeConfigCompleteMessage) String

func (e EdgeConfigCompleteMessage) String() string

type EdgeRegisteredExchangeMessage

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

This event indicates that the edge device has been registered in the exchange

func NewEdgeRegisteredExchangeMessage

func NewEdgeRegisteredExchangeMessage(evId EventId, device_id string, token string, org string, pattern string) *EdgeRegisteredExchangeMessage

func (*EdgeRegisteredExchangeMessage) DeviceId

func (e *EdgeRegisteredExchangeMessage) DeviceId() string

func (*EdgeRegisteredExchangeMessage) Event

func (*EdgeRegisteredExchangeMessage) Org

func (*EdgeRegisteredExchangeMessage) Pattern

func (EdgeRegisteredExchangeMessage) ShortString

func (e EdgeRegisteredExchangeMessage) ShortString() string

func (EdgeRegisteredExchangeMessage) String

func (*EdgeRegisteredExchangeMessage) Token

type EndContractCause

type EndContractCause string
const (
	AG_TERMINATED EndContractCause = "AG_TERMINATED"
	AG_ERROR      EndContractCause = "AG_ERROR"
	AG_FULFILLED  EndContractCause = "AG_FULFILLED"
)

type EthBlockchainEventMessage

type EthBlockchainEventMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Blockchain event occurred

func NewEthBlockchainEventMessage

func NewEthBlockchainEventMessage(id EventId, ev string, name string, org string, protocol string) *EthBlockchainEventMessage

func (*EthBlockchainEventMessage) Event

func (m *EthBlockchainEventMessage) Event() Event

func (*EthBlockchainEventMessage) Name

func (*EthBlockchainEventMessage) Org

func (*EthBlockchainEventMessage) RawEvent

func (m *EthBlockchainEventMessage) RawEvent() string

func (EthBlockchainEventMessage) ShortString

func (m EthBlockchainEventMessage) ShortString() string

func (EthBlockchainEventMessage) String

func (m EthBlockchainEventMessage) String() string

type Event

type Event struct {
	Id EventId
}

func (Event) String

func (e Event) String() string

type EventId

type EventId string
const (
	// blockchain-related
	NOOP                  EventId = "NOOP"
	AGREEMENT_ACCEPTED    EventId = "AGREEMENT_ACCEPTED"
	AGREEMENT_ENDED       EventId = "AGREEMENT_ENDED"
	AGREEMENT_CREATED     EventId = "AGREEMENT_CREATED"
	AGREEMENT_REGISTERED  EventId = "AGREEMENT_REGISTERED"
	ACCOUNT_FUNDED        EventId = "ACCOUNT_FUNDED"
	BC_CLIENT_INITIALIZED EventId = "BC_CLIENT_INITIALIZED"
	BC_CLIENT_STOPPING    EventId = "BC_CLIENT_STOPPING"
	BC_EVENT              EventId = "BC_EVENT"
	BC_NEEDED             EventId = "BC_NEEDED"
	ALL_STOP              EventId = "ALL_STOP"

	// exchange related
	RECEIVED_EXCHANGE_DEV_MSG EventId = "RECEIVED_EXCHANGE_DEV_MSG"

	// image fetching related
	IMAGE_FETCHED          EventId = "IMAGE_FETCHED"
	IMAGE_DATA_ERROR       EventId = "IMAGE_DATA_ERROR"
	IMAGE_FETCH_ERROR      EventId = "IMAGE_FETCH_ERROR"
	IMAGE_FETCH_AUTH_ERROR EventId = "IMAGE_FETCH_AUTH_ERROR"
	IMAGE_SIG_VERIF_ERROR  EventId = "IMAGE_SIG_VERIF_ERROR"

	// container-related
	EXECUTION_FAILED    EventId = "EXECUTION_FAILED"
	EXECUTION_BEGUN     EventId = "EXECUTION_BEGUN"
	WORKLOAD_DESTROYED  EventId = "WORKLOAD_DESTROYED"
	CONTAINER_STOPPING  EventId = "CONTAINER_STOPPING"
	CONTAINER_DESTROYED EventId = "CONTAINER_DESTROYED"
	CONTAINER_MAINTAIN  EventId = "CONTAINER_MAINTAIN"
	LOAD_CONTAINER      EventId = "LOAD_CONTAINER"
	START_MICROSERVICE  EventId = "START_MICROSERVICE"
	CANCEL_MICROSERVICE EventId = "CANCEL_MICROSERVICE"
	NEW_BC_CLIENT       EventId = "NEW_BC_CONTAINER"
	IMAGE_LOAD_FAILED   EventId = "IMAGE_LOAD_FAILED"

	// policy-related
	NEW_POLICY             EventId = "NEW_POLICY"
	UPDATE_POLICY          EventId = "UPDATE_POLICY"
	CHANGED_POLICY         EventId = "CHANGED_POLICY"
	DELETED_POLICY         EventId = "DELETED_POLICY"
	CACHE_SERVICE_POLICY   EventId = "CACHE_SERVICE_POLICY"
	SERVICE_POLICY_CHANGED EventId = "SERVICE_POLICY_CHANGED"
	SERVICE_POLICY_DELETED EventId = "SERVICE_POLICY_DELETED"

	// exchange-related
	NEW_DEVICE_REG             EventId = "NEW_DEVICE_REG"
	NEW_DEVICE_CONFIG_COMPLETE EventId = "NEW_DEVICE_CONFIG_COMPLETE"
	NEW_AGBOT_REG              EventId = "NEW_AGBOT_REG"

	// agreement-related
	AGREEMENT_REACHED        EventId = "AGREEMENT_REACHED"
	DEVICE_AGREEMENTS_SYNCED EventId = "DEVICE_AGREEMENTS_SYNCED"
	DEVICE_CONTAINERS_SYNCED EventId = "DEVICE_CONTAINERS_SYNCED"
	WORKLOAD_UPGRADE         EventId = "WORKLOAD_UPGRADE"

	// Node related
	START_UNCONFIGURE       EventId = "UNCONFIGURE_NODE"
	UNCONFIGURE_COMPLETE    EventId = "UNCONFIGURE_COMPLETE"
	WORKER_STOP             EventId = "WORKER_STOP"
	START_AGBOT_QUIESCE     EventId = "AGBOT_QUIESCE"
	AGBOT_QUIESCE_COMPLETE  EventId = "AGBOT_QUIESCE_COMPLETE"
	NODE_HEARTBEAT_FAILED   EventId = "HEARTBEAT_FAILED"
	NODE_HEARTBEAT_RESTORED EventId = "HEARTBEAT_RESTORED"
	UPDATE_NODE_USERINPUT   EventId = "UPDATE_USER_INPUT"

	// Service related
	SERVICE_SUSPENDED EventId = "SERVICE_SUSPENDED"

	// Object Policy related
	OBJECT_POLICY_NEW     EventId = "OBJECT_POLICY_NEW"
	OBJECT_POLICY_CHANGED EventId = "OBJECT_POLICY_CHANGED"
	OBJECT_POLICY_DELETED EventId = "OBJECT_POLICY_DELETED"
)

event constants are declared here for all workers to ensure uniqueness of constant values

type EventStateManager

type EventStateManager struct {
	Lock        sync.Mutex      // The lock to ensure reading and writing event state is serialized.
	EventRecord map[string]bool // Simply record the presence or absence of event ocurrences. The key is the event type name.
}

func NewEventStateManager

func NewEventStateManager() *EventStateManager

func (*EventStateManager) ReceivedEvent

func (em *EventStateManager) ReceivedEvent(event Message, customFunc CustomReceivedEvent) bool

func (*EventStateManager) RecordEvent

func (em *EventStateManager) RecordEvent(event Message, customFunc CustomEventRecorder)

func (*EventStateManager) String

func (em *EventStateManager) String() string

type ExchangeDeviceMessage

type ExchangeDeviceMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Exchange message received event occurred

func NewExchangeDeviceMessage

func NewExchangeDeviceMessage(id EventId, agbotId string, exMsg []byte, pMsg string) *ExchangeDeviceMessage

func (*ExchangeDeviceMessage) AgbotId

func (m *ExchangeDeviceMessage) AgbotId() string

func (*ExchangeDeviceMessage) Event

func (m *ExchangeDeviceMessage) Event() Event

func (*ExchangeDeviceMessage) ExchangeMessage

func (m *ExchangeDeviceMessage) ExchangeMessage() []byte

func (*ExchangeDeviceMessage) ProtocolMessage

func (m *ExchangeDeviceMessage) ProtocolMessage() string

func (*ExchangeDeviceMessage) ShortProtocolMessage

func (m *ExchangeDeviceMessage) ShortProtocolMessage() string

func (ExchangeDeviceMessage) ShortString

func (m ExchangeDeviceMessage) ShortString() string

func (ExchangeDeviceMessage) String

func (m ExchangeDeviceMessage) String() string

type GovernanceMaintenanceMessage

type GovernanceMaintenanceMessage struct {
	AgreementProtocol string
	AgreementId       string
	Deployment        persistence.DeploymentConfig
	// contains filtered or unexported fields
}

Governance messages

func NewGovernanceMaintenanceMessage

func NewGovernanceMaintenanceMessage(id EventId, protocol string, agreementId string, deployment persistence.DeploymentConfig) *GovernanceMaintenanceMessage

func (*GovernanceMaintenanceMessage) Event

func (GovernanceMaintenanceMessage) ShortString

func (m GovernanceMaintenanceMessage) ShortString() string

func (GovernanceMaintenanceMessage) String

type GovernanceWorkloadCancelationMessage

type GovernanceWorkloadCancelationMessage struct {
	GovernanceMaintenanceMessage
	Message
	Cause EndContractCause
}

func NewGovernanceWorkloadCancelationMessage

func NewGovernanceWorkloadCancelationMessage(id EventId, cause EndContractCause, protocol string, agreementId string, deployment persistence.DeploymentConfig) *GovernanceWorkloadCancelationMessage

func (*GovernanceWorkloadCancelationMessage) Event

func (GovernanceWorkloadCancelationMessage) ShortString

func (GovernanceWorkloadCancelationMessage) String

type ImageDockerAuth

type ImageDockerAuth struct {
	Registry string `json:"registry"`
	UserName string `json:"username"`
	Password string `json:"token"`
}

func (ImageDockerAuth) String

func (s ImageDockerAuth) String() string

type ImageFetchMessage

type ImageFetchMessage struct {
	DeploymentDescription *containermessage.DeploymentDescription
	LaunchContext         interface{}
	// contains filtered or unexported fields
}

func NewImageFetchMessage

func NewImageFetchMessage(id EventId, deploymentDescription *containermessage.DeploymentDescription, launchContext interface{}) *ImageFetchMessage

func (*ImageFetchMessage) Event

func (b *ImageFetchMessage) Event() Event

fulfill interface of events.Message

func (*ImageFetchMessage) ShortString

func (b *ImageFetchMessage) ShortString() string

func (*ImageFetchMessage) String

func (b *ImageFetchMessage) String() string

type InitAgreementCancelationMessage

type InitAgreementCancelationMessage struct {
	AgreementProtocol string
	AgreementId       string
	Deployment        persistence.DeploymentConfig
	Reason            uint
	// contains filtered or unexported fields
}

Initialization and restart messages

func NewInitAgreementCancelationMessage

func NewInitAgreementCancelationMessage(id EventId, reason uint, protocol string, agreementId string, deployment persistence.DeploymentConfig) *InitAgreementCancelationMessage

func (*InitAgreementCancelationMessage) Event

func (InitAgreementCancelationMessage) ShortString

func (m InitAgreementCancelationMessage) ShortString() string

func (InitAgreementCancelationMessage) String

type LaunchContext

type LaunchContext interface {
	ContainerConfig() ContainerConfig
	ShortString() string
}

type LoadContainerMessage

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

Anax device side fires this event when it needs to download and load a container.

func NewLoadContainerMessage

func NewLoadContainerMessage(id EventId, lc *ContainerLaunchContext) *LoadContainerMessage

func (*LoadContainerMessage) Event

func (e *LoadContainerMessage) Event() Event

func (*LoadContainerMessage) LaunchContext

func (e *LoadContainerMessage) LaunchContext() *ContainerLaunchContext

func (LoadContainerMessage) ShortString

func (e LoadContainerMessage) ShortString() string

func (LoadContainerMessage) String

func (e LoadContainerMessage) String() string

type MMSObjectPolicyMessage

type MMSObjectPolicyMessage struct {
	NewPolicy interface{} // Holds an object of type exchange.ObjectDestinationPolicy
	OldPolicy interface{} // Holds an object of type exchange.ObjectDestinationPolicy
	// contains filtered or unexported fields
}

func NewMMSObjectPolicyMessage

func NewMMSObjectPolicyMessage(id EventId, np interface{}, op interface{}) *MMSObjectPolicyMessage

func (*MMSObjectPolicyMessage) Event

func (w *MMSObjectPolicyMessage) Event() Event

func (*MMSObjectPolicyMessage) ShortString

func (w *MMSObjectPolicyMessage) ShortString() string

func (*MMSObjectPolicyMessage) String

func (w *MMSObjectPolicyMessage) String() string

type Message

type Message interface {
	Event() Event
	ShortString() string
}

type MicroserviceCancellationMessage

type MicroserviceCancellationMessage struct {
	MsInstKey string // the key to the microservice instance
	// contains filtered or unexported fields
}

func NewMicroserviceCancellationMessage

func NewMicroserviceCancellationMessage(id EventId, key string) *MicroserviceCancellationMessage

func (*MicroserviceCancellationMessage) Event

func (MicroserviceCancellationMessage) ShortString

func (m MicroserviceCancellationMessage) ShortString() string

func (MicroserviceCancellationMessage) String

type MicroserviceContainersDestroyedMessage

type MicroserviceContainersDestroyedMessage struct {
	MsInstKey string // the key to the microservice instance
	// contains filtered or unexported fields
}

func NewMicroserviceContainersDestroyedMessage

func NewMicroserviceContainersDestroyedMessage(id EventId, key string) *MicroserviceContainersDestroyedMessage

func (*MicroserviceContainersDestroyedMessage) Event

func (MicroserviceContainersDestroyedMessage) ShortString

func (MicroserviceContainersDestroyedMessage) String

type MicroserviceMaintenanceMessage

type MicroserviceMaintenanceMessage struct {
	MsInstKey string // the key to the microservice instance, it is used for network id and part of container name
	// contains filtered or unexported fields
}

func NewMicroserviceMaintenanceMessage

func NewMicroserviceMaintenanceMessage(id EventId, key string) *MicroserviceMaintenanceMessage

func (*MicroserviceMaintenanceMessage) Event

func (MicroserviceMaintenanceMessage) ShortString

func (m MicroserviceMaintenanceMessage) ShortString() string

func (MicroserviceMaintenanceMessage) String

type MicroserviceSpec

type MicroserviceSpec struct {
	SpecRef string
	Org     string
	Version string
	MsdefId string
}

type NewBCContainerMessage

type NewBCContainerMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Make sure eth container is up and running

func NewNewBCContainerMessage

func NewNewBCContainerMessage(id EventId, typeName string, instance string, org string, exchangeURL string, exchangeId string, exchangeToken string) *NewBCContainerMessage

func (*NewBCContainerMessage) Event

func (m *NewBCContainerMessage) Event() Event

func (*NewBCContainerMessage) ExchangeId

func (m *NewBCContainerMessage) ExchangeId() string

func (*NewBCContainerMessage) ExchangeToken

func (m *NewBCContainerMessage) ExchangeToken() string

func (*NewBCContainerMessage) ExchangeURL

func (m *NewBCContainerMessage) ExchangeURL() string

func (*NewBCContainerMessage) Instance

func (m *NewBCContainerMessage) Instance() string

func (*NewBCContainerMessage) Org

func (m *NewBCContainerMessage) Org() string

func (NewBCContainerMessage) ShortString

func (m NewBCContainerMessage) ShortString() string

func (NewBCContainerMessage) String

func (m NewBCContainerMessage) String() string

func (*NewBCContainerMessage) TypeName

func (m *NewBCContainerMessage) TypeName() string

type NodeHeartbeatStateChangeMessage

type NodeHeartbeatStateChangeMessage struct {
	NodeOrg string
	NodeId  string
	// contains filtered or unexported fields
}

func NewNodeHeartbeatStateChangeMessage

func NewNodeHeartbeatStateChangeMessage(id EventId, node_org string, node_id string) *NodeHeartbeatStateChangeMessage

func (*NodeHeartbeatStateChangeMessage) Event

func (*NodeHeartbeatStateChangeMessage) ShortString

func (w *NodeHeartbeatStateChangeMessage) ShortString() string

func (*NodeHeartbeatStateChangeMessage) String

type NodePolicyMessage

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

This event indicates that something happened with a node policy.

func NewNodePolicyMessage

func NewNodePolicyMessage(id EventId) *NodePolicyMessage

func (NodePolicyMessage) Event

func (e NodePolicyMessage) Event() Event

func (NodePolicyMessage) ShortString

func (e NodePolicyMessage) ShortString() string

func (NodePolicyMessage) String

func (e NodePolicyMessage) String() string

type NodeShutdownCompleteMessage

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

func NewNodeShutdownCompleteMessage

func NewNodeShutdownCompleteMessage(id EventId, errorMsg string) *NodeShutdownCompleteMessage

func (NodeShutdownCompleteMessage) Err

func (*NodeShutdownCompleteMessage) Event

func (NodeShutdownCompleteMessage) ShortString

func (n NodeShutdownCompleteMessage) ShortString() string

func (NodeShutdownCompleteMessage) String

type NodeShutdownMessage

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

Node lifecycle events

func NewNodeShutdownMessage

func NewNodeShutdownMessage(id EventId, blocking bool, removeNode bool) *NodeShutdownMessage

func (NodeShutdownMessage) Blocking

func (n NodeShutdownMessage) Blocking() bool

func (*NodeShutdownMessage) Event

func (n *NodeShutdownMessage) Event() Event

func (NodeShutdownMessage) RemoveNode

func (n NodeShutdownMessage) RemoveNode() bool

func (NodeShutdownMessage) ShortString

func (n NodeShutdownMessage) ShortString() string

func (NodeShutdownMessage) String

func (n NodeShutdownMessage) String() string

type NodeUserInputMessage

type NodeUserInputMessage struct {
	ServiceSpecs persistence.ServiceSpecs
	// contains filtered or unexported fields
}

This event indicates that something happened with node user input.

func NewNodeUserInputMessage

func NewNodeUserInputMessage(id EventId, svcSpecs persistence.ServiceSpecs) *NodeUserInputMessage

func (NodeUserInputMessage) Event

func (e NodeUserInputMessage) Event() Event

func (NodeUserInputMessage) ShortString

func (e NodeUserInputMessage) ShortString() string

func (NodeUserInputMessage) String

func (e NodeUserInputMessage) String() string

type PolicyChangedMessage

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

This event indicates that a policy file has changed. It might also be a new policy file in the agbot.

func NewPolicyChangedMessage

func NewPolicyChangedMessage(id EventId, policyFileName string, policyName string, org string, policy string) *PolicyChangedMessage

func (*PolicyChangedMessage) Event

func (e *PolicyChangedMessage) Event() Event

func (*PolicyChangedMessage) Org

func (e *PolicyChangedMessage) Org() string

func (*PolicyChangedMessage) PolicyFile

func (e *PolicyChangedMessage) PolicyFile() string

func (*PolicyChangedMessage) PolicyName

func (e *PolicyChangedMessage) PolicyName() string

func (*PolicyChangedMessage) PolicyString

func (e *PolicyChangedMessage) PolicyString() string

func (PolicyChangedMessage) ShortString

func (e PolicyChangedMessage) ShortString() string

func (PolicyChangedMessage) String

func (e PolicyChangedMessage) String() string

type PolicyCreatedMessage

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

This event indicates that a new microservice has been created in the form of a policy file

func NewPolicyCreatedMessage

func NewPolicyCreatedMessage(id EventId, policyFileName string) *PolicyCreatedMessage

func (PolicyCreatedMessage) Event

func (e PolicyCreatedMessage) Event() Event

func (*PolicyCreatedMessage) PolicyFile

func (e *PolicyCreatedMessage) PolicyFile() string

func (PolicyCreatedMessage) ShortString

func (e PolicyCreatedMessage) ShortString() string

func (PolicyCreatedMessage) String

func (e PolicyCreatedMessage) String() string

type PolicyDeletedMessage

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

This event indicates that a policy file was deleted.

func NewPolicyDeletedMessage

func NewPolicyDeletedMessage(id EventId, policyFileName string, policyName string, org string, policy string) *PolicyDeletedMessage

func (*PolicyDeletedMessage) Event

func (e *PolicyDeletedMessage) Event() Event

func (*PolicyDeletedMessage) Org

func (e *PolicyDeletedMessage) Org() string

func (*PolicyDeletedMessage) PolicyFile

func (e *PolicyDeletedMessage) PolicyFile() string

func (*PolicyDeletedMessage) PolicyName

func (e *PolicyDeletedMessage) PolicyName() string

func (*PolicyDeletedMessage) PolicyString

func (e *PolicyDeletedMessage) PolicyString() string

func (PolicyDeletedMessage) ShortString

func (e PolicyDeletedMessage) ShortString() string

func (PolicyDeletedMessage) String

func (e PolicyDeletedMessage) String() string

type ReportNeededBlockchainsMessage

type ReportNeededBlockchainsMessage struct {
	Time uint64
	// contains filtered or unexported fields
}

Report of blockchains that are needed

func NewReportNeededBlockchainsMessage

func NewReportNeededBlockchainsMessage(id EventId, bcType string, neededBCs map[string]map[string]bool) *ReportNeededBlockchainsMessage

func (ReportNeededBlockchainsMessage) BlockchainType

func (m ReportNeededBlockchainsMessage) BlockchainType() string

func (*ReportNeededBlockchainsMessage) Event

func (ReportNeededBlockchainsMessage) NeededBlockchains

func (m ReportNeededBlockchainsMessage) NeededBlockchains() map[string]map[string]bool

func (ReportNeededBlockchainsMessage) ShortString

func (m ReportNeededBlockchainsMessage) ShortString() string

func (ReportNeededBlockchainsMessage) String

type ServiceConfigState

type ServiceConfigState struct {
	Url         string `json:"url"`
	Org         string `json:"org"`
	ConfigState string `json:"configState"`
}

func NewServiceConfigState

func NewServiceConfigState(url, org, state string) *ServiceConfigState

func (*ServiceConfigState) String

func (s *ServiceConfigState) String() string

type ServiceConfigStateChangeMessage

type ServiceConfigStateChangeMessage struct {
	ServiceConfigState []ServiceConfigState
	// contains filtered or unexported fields
}

func NewServiceConfigStateChangeMessage

func NewServiceConfigStateChangeMessage(id EventId, scs []ServiceConfigState) *ServiceConfigStateChangeMessage

func (*ServiceConfigStateChangeMessage) Event

func (*ServiceConfigStateChangeMessage) ShortString

func (w *ServiceConfigStateChangeMessage) ShortString() string

func (*ServiceConfigStateChangeMessage) String

type ServicePolicyChangedMessage

type ServicePolicyChangedMessage struct {
	BusinessPolOrg  string
	BusinessPolName string
	ServiceId       string
	NewServicePol   string
	// contains filtered or unexported fields
}

func NewServicePolicyChangedMessage

func NewServicePolicyChangedMessage(id EventId, bPolOrg, bPolName, svcId string, polString string) *ServicePolicyChangedMessage

func (*ServicePolicyChangedMessage) Event

func (ServicePolicyChangedMessage) ShortString

func (e ServicePolicyChangedMessage) ShortString() string

func (ServicePolicyChangedMessage) String

type ServicePolicyDeletedMessage

type ServicePolicyDeletedMessage struct {
	BusinessPolOrg  string
	BusinessPolName string
	ServiceId       string
	// contains filtered or unexported fields
}

func NewServicePolicyDeletedMessage

func NewServicePolicyDeletedMessage(id EventId, bPolOrg, bPolName, svcId string) *ServicePolicyDeletedMessage

func (*ServicePolicyDeletedMessage) Event

func (ServicePolicyDeletedMessage) ShortString

func (e ServicePolicyDeletedMessage) ShortString() string

func (ServicePolicyDeletedMessage) String

type UpdatePolicyMessage

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

This event indicates that something has changed on the node which requires that the node policies are updated.

func NewUpdatePolicyMessage

func NewUpdatePolicyMessage(id EventId) *UpdatePolicyMessage

func (UpdatePolicyMessage) Event

func (e UpdatePolicyMessage) Event() Event

func (UpdatePolicyMessage) ShortString

func (e UpdatePolicyMessage) ShortString() string

func (UpdatePolicyMessage) String

func (e UpdatePolicyMessage) String() string

type WorkerStopMessage

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

This is a special message that the message dispatcher knows about.

func NewWorkerStopMessage

func NewWorkerStopMessage(id EventId, name string) *WorkerStopMessage

func (*WorkerStopMessage) Event

func (w *WorkerStopMessage) Event() Event

func (*WorkerStopMessage) Name

func (w *WorkerStopMessage) Name() string

func (*WorkerStopMessage) ShortString

func (w *WorkerStopMessage) ShortString() string

func (*WorkerStopMessage) String

func (w *WorkerStopMessage) String() string

type WorkloadMessage

type WorkloadMessage struct {
	AgreementProtocol string
	AgreementId       string
	Deployment        persistence.DeploymentConfig
	// contains filtered or unexported fields
}

Workload messages

func NewWorkloadMessage

func NewWorkloadMessage(id EventId, protocol string, agreementId string, deployment persistence.DeploymentConfig) *WorkloadMessage

func (WorkloadMessage) Event

func (b WorkloadMessage) Event() Event

func (WorkloadMessage) ShortString

func (m WorkloadMessage) ShortString() string

func (WorkloadMessage) String

func (m WorkloadMessage) String() string

Jump to

Keyboard shortcuts

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