Documentation ¶
Index ¶
- type ABApiAgreementCancelationMessage
- type ABApiWorkloadUpgradeMessage
- type AccountFundedMessage
- func (m AccountFundedMessage) BlockchainInstance() string
- func (m AccountFundedMessage) BlockchainOrg() string
- func (m AccountFundedMessage) BlockchainType() string
- func (m AccountFundedMessage) ColonusDir() string
- func (m *AccountFundedMessage) Event() Event
- func (m AccountFundedMessage) ServiceName() string
- func (m AccountFundedMessage) ServicePort() string
- func (m AccountFundedMessage) ShortString() string
- func (m AccountFundedMessage) String() string
- type AgreementLaunchContext
- type AgreementReachedMessage
- type AllBlockchainShutdownMessage
- type ApiAgreementCancelationMessage
- type BlockchainClientInitializedMessage
- func (m BlockchainClientInitializedMessage) BlockchainInstance() string
- func (m BlockchainClientInitializedMessage) BlockchainOrg() string
- func (m BlockchainClientInitializedMessage) BlockchainType() string
- func (m BlockchainClientInitializedMessage) ColonusDir() string
- func (m *BlockchainClientInitializedMessage) Event() Event
- func (m BlockchainClientInitializedMessage) ServiceName() string
- func (m BlockchainClientInitializedMessage) ServicePort() string
- func (m BlockchainClientInitializedMessage) ShortString() string
- func (m BlockchainClientInitializedMessage) String() string
- type BlockchainClientStoppingMessage
- func (m BlockchainClientStoppingMessage) BlockchainInstance() string
- func (m BlockchainClientStoppingMessage) BlockchainOrg() string
- func (m BlockchainClientStoppingMessage) BlockchainType() string
- func (m *BlockchainClientStoppingMessage) Event() Event
- func (m BlockchainClientStoppingMessage) ShortString() string
- func (m BlockchainClientStoppingMessage) String() string
- type BlockchainConfig
- type CacheServicePolicyMessage
- type ContainerConfig
- type ContainerLaunchContext
- func (c ContainerLaunchContext) ContainerConfig() ContainerConfig
- func (c ContainerLaunchContext) GetAgreementIds() []string
- func (c ContainerLaunchContext) GetMicroservices() []MicroserviceSpec
- func (c ContainerLaunchContext) GetServicePathElement() *persistence.ServiceInstancePathElement
- func (c ContainerLaunchContext) ShortString() string
- func (c ContainerLaunchContext) String() string
- type ContainerMessage
- type ContainerShutdownMessage
- type ContainerStopMessage
- type CustomEventRecorder
- type CustomReceivedEvent
- type DeviceAgreementsSyncedMessage
- type DeviceContainersSyncedMessage
- type EdgeConfigCompleteMessage
- type EdgeRegisteredExchangeMessage
- func (e *EdgeRegisteredExchangeMessage) DeviceId() string
- func (e *EdgeRegisteredExchangeMessage) Event() Event
- func (e *EdgeRegisteredExchangeMessage) Org() string
- func (e *EdgeRegisteredExchangeMessage) Pattern() string
- func (e EdgeRegisteredExchangeMessage) ShortString() string
- func (e EdgeRegisteredExchangeMessage) String() string
- func (e *EdgeRegisteredExchangeMessage) Token() string
- type EndContractCause
- type EthBlockchainEventMessage
- func (m *EthBlockchainEventMessage) Event() Event
- func (m *EthBlockchainEventMessage) Name() string
- func (m *EthBlockchainEventMessage) Org() string
- func (m *EthBlockchainEventMessage) RawEvent() string
- func (m EthBlockchainEventMessage) ShortString() string
- func (m EthBlockchainEventMessage) String() string
- type Event
- type EventId
- type EventStateManager
- type ExchangeDeviceMessage
- func (m *ExchangeDeviceMessage) AgbotId() string
- func (m *ExchangeDeviceMessage) Event() Event
- func (m *ExchangeDeviceMessage) ExchangeMessage() []byte
- func (m *ExchangeDeviceMessage) ProtocolMessage() string
- func (m *ExchangeDeviceMessage) ShortProtocolMessage() string
- func (m ExchangeDeviceMessage) ShortString() string
- func (m ExchangeDeviceMessage) String() string
- type GovernanceMaintenanceMessage
- type GovernanceWorkloadCancelationMessage
- type ImageDockerAuth
- type ImageFetchMessage
- type InitAgreementCancelationMessage
- type LaunchContext
- type LoadContainerMessage
- type MMSObjectPolicyMessage
- type Message
- type MicroserviceCancellationMessage
- type MicroserviceContainersDestroyedMessage
- type MicroserviceMaintenanceMessage
- type MicroserviceSpec
- type NewBCContainerMessage
- func (m *NewBCContainerMessage) Event() Event
- func (m *NewBCContainerMessage) ExchangeId() string
- func (m *NewBCContainerMessage) ExchangeToken() string
- func (m *NewBCContainerMessage) ExchangeURL() string
- func (m *NewBCContainerMessage) Instance() string
- func (m *NewBCContainerMessage) Org() string
- func (m NewBCContainerMessage) ShortString() string
- func (m NewBCContainerMessage) String() string
- func (m *NewBCContainerMessage) TypeName() string
- type NodeHeartbeatStateChangeMessage
- type NodePolicyMessage
- type NodeShutdownCompleteMessage
- type NodeShutdownMessage
- type NodeUserInputMessage
- type PolicyChangedMessage
- func (e *PolicyChangedMessage) Event() Event
- func (e *PolicyChangedMessage) Org() string
- func (e *PolicyChangedMessage) PolicyFile() string
- func (e *PolicyChangedMessage) PolicyName() string
- func (e *PolicyChangedMessage) PolicyString() string
- func (e PolicyChangedMessage) ShortString() string
- func (e PolicyChangedMessage) String() string
- type PolicyCreatedMessage
- type PolicyDeletedMessage
- func (e *PolicyDeletedMessage) Event() Event
- func (e *PolicyDeletedMessage) Org() string
- func (e *PolicyDeletedMessage) PolicyFile() string
- func (e *PolicyDeletedMessage) PolicyName() string
- func (e *PolicyDeletedMessage) PolicyString() string
- func (e PolicyDeletedMessage) ShortString() string
- func (e PolicyDeletedMessage) String() string
- type ReportNeededBlockchainsMessage
- func (m ReportNeededBlockchainsMessage) BlockchainType() string
- func (m *ReportNeededBlockchainsMessage) Event() Event
- func (m ReportNeededBlockchainsMessage) NeededBlockchains() map[string]map[string]bool
- func (m ReportNeededBlockchainsMessage) ShortString() string
- func (m ReportNeededBlockchainsMessage) String() string
- type ServiceConfigState
- type ServiceConfigStateChangeMessage
- type ServicePolicyChangedMessage
- type ServicePolicyDeletedMessage
- type UpdatePolicyMessage
- type WorkerStopMessage
- type WorkloadMessage
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 (m *ABApiAgreementCancelationMessage) Event() Event
func (ABApiAgreementCancelationMessage) ShortString ¶
func (m ABApiAgreementCancelationMessage) ShortString() string
func (ABApiAgreementCancelationMessage) String ¶
func (m ABApiAgreementCancelationMessage) String() string
type ABApiWorkloadUpgradeMessage ¶
type ABApiWorkloadUpgradeMessage struct { AgreementProtocol string AgreementId string DeviceId string PolicyName string // contains filtered or unexported fields }
func (*ABApiWorkloadUpgradeMessage) Event ¶
func (m *ABApiWorkloadUpgradeMessage) Event() Event
func (ABApiWorkloadUpgradeMessage) ShortString ¶
func (m ABApiWorkloadUpgradeMessage) ShortString() string
func (ABApiWorkloadUpgradeMessage) String ¶
func (m ABApiWorkloadUpgradeMessage) String() string
type AccountFundedMessage ¶
type AccountFundedMessage struct { Account string Time uint64 // contains filtered or unexported fields }
Account funded message
func NewAccountFundedMessage ¶
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 NewAgreementMessage ¶
func NewAgreementMessage(id EventId, lc *AgreementLaunchContext) *AgreementReachedMessage
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 (w *AllBlockchainShutdownMessage) Event() Event
func (*AllBlockchainShutdownMessage) ShortString ¶
func (w *AllBlockchainShutdownMessage) ShortString() string
func (*AllBlockchainShutdownMessage) String ¶
func (w *AllBlockchainShutdownMessage) String() 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 (m *ApiAgreementCancelationMessage) Event() Event
func (ApiAgreementCancelationMessage) ShortString ¶
func (m ApiAgreementCancelationMessage) ShortString() string
func (ApiAgreementCancelationMessage) String ¶
func (m ApiAgreementCancelationMessage) String() string
type BlockchainClientInitializedMessage ¶
type BlockchainClientInitializedMessage struct { Time uint64 // contains filtered or unexported fields }
Blockchain client initialized message
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 (m BlockchainClientInitializedMessage) ColonusDir() string
func (*BlockchainClientInitializedMessage) Event ¶
func (m *BlockchainClientInitializedMessage) Event() Event
func (BlockchainClientInitializedMessage) ServiceName ¶
func (m BlockchainClientInitializedMessage) ServiceName() string
func (BlockchainClientInitializedMessage) ServicePort ¶
func (m BlockchainClientInitializedMessage) ServicePort() string
func (BlockchainClientInitializedMessage) ShortString ¶
func (m BlockchainClientInitializedMessage) ShortString() string
func (BlockchainClientInitializedMessage) String ¶
func (m BlockchainClientInitializedMessage) String() 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 (m *BlockchainClientStoppingMessage) Event() Event
func (BlockchainClientStoppingMessage) ShortString ¶
func (m BlockchainClientStoppingMessage) ShortString() string
func (BlockchainClientStoppingMessage) String ¶
func (m BlockchainClientStoppingMessage) String() string
type BlockchainConfig ¶
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 (c ContainerLaunchContext) GetServicePathElement() *persistence.ServiceInstancePathElement
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 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 (m *DeviceAgreementsSyncedMessage) Event() Event
func (*DeviceAgreementsSyncedMessage) IsCompleted ¶
func (m *DeviceAgreementsSyncedMessage) IsCompleted() bool
func (DeviceAgreementsSyncedMessage) ShortString ¶
func (m DeviceAgreementsSyncedMessage) ShortString() string
func (DeviceAgreementsSyncedMessage) String ¶
func (m DeviceAgreementsSyncedMessage) String() 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 (m *DeviceContainersSyncedMessage) Event() Event
func (*DeviceContainersSyncedMessage) IsCompleted ¶
func (m *DeviceContainersSyncedMessage) IsCompleted() bool
func (DeviceContainersSyncedMessage) ShortString ¶
func (m DeviceContainersSyncedMessage) ShortString() string
func (DeviceContainersSyncedMessage) String ¶
func (m DeviceContainersSyncedMessage) String() 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 (*EdgeRegisteredExchangeMessage) DeviceId ¶
func (e *EdgeRegisteredExchangeMessage) DeviceId() string
func (*EdgeRegisteredExchangeMessage) Event ¶
func (e *EdgeRegisteredExchangeMessage) Event() Event
func (*EdgeRegisteredExchangeMessage) Org ¶
func (e *EdgeRegisteredExchangeMessage) Org() string
func (*EdgeRegisteredExchangeMessage) Pattern ¶
func (e *EdgeRegisteredExchangeMessage) Pattern() string
func (EdgeRegisteredExchangeMessage) ShortString ¶
func (e EdgeRegisteredExchangeMessage) ShortString() string
func (EdgeRegisteredExchangeMessage) String ¶
func (e EdgeRegisteredExchangeMessage) String() string
func (*EdgeRegisteredExchangeMessage) Token ¶
func (e *EdgeRegisteredExchangeMessage) Token() string
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 (*EthBlockchainEventMessage) Event ¶
func (m *EthBlockchainEventMessage) Event() Event
func (*EthBlockchainEventMessage) Name ¶
func (m *EthBlockchainEventMessage) Name() string
func (*EthBlockchainEventMessage) Org ¶
func (m *EthBlockchainEventMessage) Org() string
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 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 (m *GovernanceMaintenanceMessage) Event() Event
func (GovernanceMaintenanceMessage) ShortString ¶
func (m GovernanceMaintenanceMessage) ShortString() string
func (GovernanceMaintenanceMessage) String ¶
func (m GovernanceMaintenanceMessage) String() 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 (m *GovernanceWorkloadCancelationMessage) Event() Event
func (GovernanceWorkloadCancelationMessage) ShortString ¶
func (m GovernanceWorkloadCancelationMessage) ShortString() string
func (GovernanceWorkloadCancelationMessage) String ¶
func (m GovernanceWorkloadCancelationMessage) String() 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 (m *InitAgreementCancelationMessage) Event() Event
func (InitAgreementCancelationMessage) ShortString ¶
func (m InitAgreementCancelationMessage) ShortString() string
func (InitAgreementCancelationMessage) String ¶
func (m InitAgreementCancelationMessage) String() 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 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 (m *MicroserviceCancellationMessage) Event() Event
func (MicroserviceCancellationMessage) ShortString ¶
func (m MicroserviceCancellationMessage) ShortString() string
func (MicroserviceCancellationMessage) String ¶
func (m MicroserviceCancellationMessage) String() 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 (m *MicroserviceContainersDestroyedMessage) Event() Event
func (MicroserviceContainersDestroyedMessage) ShortString ¶
func (m MicroserviceContainersDestroyedMessage) ShortString() string
func (MicroserviceContainersDestroyedMessage) String ¶
func (m MicroserviceContainersDestroyedMessage) String() 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 (m *MicroserviceMaintenanceMessage) Event() Event
func (MicroserviceMaintenanceMessage) ShortString ¶
func (m MicroserviceMaintenanceMessage) ShortString() string
func (MicroserviceMaintenanceMessage) String ¶
func (m MicroserviceMaintenanceMessage) String() string
type MicroserviceSpec ¶
type NewBCContainerMessage ¶
type NewBCContainerMessage struct { Time uint64 // contains filtered or unexported fields }
Make sure eth container is up and running
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 (w *NodeHeartbeatStateChangeMessage) Event() Event
func (*NodeHeartbeatStateChangeMessage) ShortString ¶
func (w *NodeHeartbeatStateChangeMessage) ShortString() string
func (*NodeHeartbeatStateChangeMessage) String ¶
func (w *NodeHeartbeatStateChangeMessage) String() 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 (n NodeShutdownCompleteMessage) Err() string
func (*NodeShutdownCompleteMessage) Event ¶
func (n *NodeShutdownCompleteMessage) Event() Event
func (NodeShutdownCompleteMessage) ShortString ¶
func (n NodeShutdownCompleteMessage) ShortString() string
func (NodeShutdownCompleteMessage) String ¶
func (n NodeShutdownCompleteMessage) String() 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 (*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 (*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 (ReportNeededBlockchainsMessage) BlockchainType ¶
func (m ReportNeededBlockchainsMessage) BlockchainType() string
func (*ReportNeededBlockchainsMessage) Event ¶
func (m *ReportNeededBlockchainsMessage) Event() Event
func (ReportNeededBlockchainsMessage) NeededBlockchains ¶
func (m ReportNeededBlockchainsMessage) NeededBlockchains() map[string]map[string]bool
func (ReportNeededBlockchainsMessage) ShortString ¶
func (m ReportNeededBlockchainsMessage) ShortString() string
func (ReportNeededBlockchainsMessage) String ¶
func (m ReportNeededBlockchainsMessage) String() 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 (w *ServiceConfigStateChangeMessage) Event() Event
func (*ServiceConfigStateChangeMessage) ShortString ¶
func (w *ServiceConfigStateChangeMessage) ShortString() string
func (*ServiceConfigStateChangeMessage) String ¶
func (w *ServiceConfigStateChangeMessage) String() 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 (e *ServicePolicyChangedMessage) Event() Event
func (ServicePolicyChangedMessage) ShortString ¶
func (e ServicePolicyChangedMessage) ShortString() string
func (ServicePolicyChangedMessage) String ¶
func (e ServicePolicyChangedMessage) String() 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 (e *ServicePolicyDeletedMessage) Event() Event
func (ServicePolicyDeletedMessage) ShortString ¶
func (e ServicePolicyDeletedMessage) ShortString() string
func (ServicePolicyDeletedMessage) String ¶
func (e ServicePolicyDeletedMessage) String() 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