Documentation
¶
Index ¶
- Variables
- type Accessor
- type ApprovalThresholdPolicy
- type CloudWatchLogState
- type ExportedMember
- type ExportedNetwork
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AddAccessorInternal(region, accountID, accessorType, networkType string) *Accessor
- func (b *InMemoryBackend) AddInvitationInternal(region, accountID, networkID, networkName string) *Invitation
- func (b *InMemoryBackend) AddMemberInternal(region, accountID, networkID, name string) *Member
- func (b *InMemoryBackend) AddNetworkInternal(region, accountID, name string) *Network
- func (b *InMemoryBackend) AddNodeInternal(region, accountID, networkID, memberID, instanceType string) *Node
- func (b *InMemoryBackend) AddProposalInternal(region, accountID, networkID, memberID, description string) *Proposal
- func (b *InMemoryBackend) CreateAccessor(region, accountID, accessorType, networkType string, tags map[string]string) (*Accessor, error)
- func (b *InMemoryBackend) CreateMember(...) (*Member, error)
- func (b *InMemoryBackend) CreateNetwork(...) (*Network, *Member, error)
- func (b *InMemoryBackend) CreateNode(...) (*Node, error)
- func (b *InMemoryBackend) CreateProposal(region, accountID, networkID, memberID, description string, ...) (*Proposal, error)
- func (b *InMemoryBackend) DeleteAccessor(accessorID string) error
- func (b *InMemoryBackend) DeleteMember(networkID, memberID string) error
- func (b *InMemoryBackend) DeleteNode(networkID, memberID, nodeID string) error
- func (b *InMemoryBackend) GetAccessor(accessorID string) (*Accessor, error)
- func (b *InMemoryBackend) GetMember(networkID, memberID string) (*Member, error)
- func (b *InMemoryBackend) GetNetwork(networkID string) (*Network, error)
- func (b *InMemoryBackend) GetNode(networkID, memberID, nodeID string) (*Node, error)
- func (b *InMemoryBackend) GetProposal(networkID, proposalID string) (*Proposal, error)
- func (b *InMemoryBackend) ListAccessors(filter ListAccessorsFilter) ([]*Accessor, error)
- func (b *InMemoryBackend) ListInvitations() ([]*Invitation, error)
- func (b *InMemoryBackend) ListMembers(networkID string, filter ListMembersFilter) ([]*Member, error)
- func (b *InMemoryBackend) ListNetworks(filter ListNetworksFilter) ([]*Network, error)
- func (b *InMemoryBackend) ListNodes(networkID, memberID string, filter ListNodesFilter) ([]*Node, error)
- func (b *InMemoryBackend) ListProposalVotes(networkID, proposalID string) ([]*ProposalVote, error)
- func (b *InMemoryBackend) ListProposals(networkID, statusFilter string) ([]*Proposal, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) RejectInvitation(invitationID string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateMember(networkID, memberID string, logConfig *MemberLogPublishingConfigState) (*Member, error)
- func (b *InMemoryBackend) UpdateNode(networkID, memberID, nodeID string, logConfig *NodeLogPublishingConfigState) (*Node, error)
- func (b *InMemoryBackend) VoteOnProposal(networkID, proposalID, memberID, vote string) error
- type Invitation
- type InvitationNetworkSummary
- type InviteAction
- type ListAccessorsFilter
- type ListMembersFilter
- type ListNetworksFilter
- type ListNodesFilter
- type LogConfigState
- type Member
- type MemberFabricAttributesState
- type MemberFabricLogState
- type MemberFrameworkAttributesState
- type MemberLogPublishingConfigState
- type MemberSummary
- type Network
- type NetworkFabricAttributesState
- type NetworkFrameworkAttributesState
- type NetworkSummary
- type Node
- type NodeFabricAttributesState
- type NodeFabricLogState
- type NodeFrameworkAttributesState
- type NodeLogPublishingConfigState
- type NodeSummary
- type Proposal
- type ProposalActions
- type ProposalVote
- type Provider
- type RemoveAction
- type StorageBackend
- type VotingPolicy
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNetworkNotFound is returned when a network does not exist. ErrNetworkNotFound = awserr.New("ResourceNotFoundException: network not found", awserr.ErrNotFound) // ErrMemberNotFound is returned when a member does not exist. ErrMemberNotFound = awserr.New("ResourceNotFoundException: member not found", awserr.ErrNotFound) // ErrResourceNotFound is returned when a resource (network or member) cannot be found by ARN. ErrResourceNotFound = awserr.New("ResourceNotFoundException: resource not found", awserr.ErrNotFound) // ErrNetworkAlreadyExists is returned when a network already exists. ErrNetworkAlreadyExists = awserr.New( "ResourceAlreadyExistsException: network already exists", awserr.ErrAlreadyExists, ) // ErrMissingNetworkName is returned when the network name is missing. ErrMissingNetworkName = errors.New("Name is required for CreateNetwork") // ErrMissingMemberName is returned when the member name is missing. ErrMissingMemberName = errors.New("Name is required for member configuration") // ErrMissingNetworkID is returned when the network ID is missing from a path. ErrMissingNetworkID = errors.New("networkId is required") // ErrNodeNotFound is returned when a node does not exist. ErrNodeNotFound = awserr.New("ResourceNotFoundException: node not found", awserr.ErrNotFound) // ErrAccessorNotFound is returned when an accessor does not exist. ErrAccessorNotFound = awserr.New("ResourceNotFoundException: accessor not found", awserr.ErrNotFound) // ErrProposalNotFound is returned when a proposal does not exist. ErrProposalNotFound = awserr.New("ResourceNotFoundException: proposal not found", awserr.ErrNotFound) // ErrInvitationNotFound is returned when an invitation does not exist. ErrInvitationNotFound = awserr.New("ResourceNotFoundException: invitation not found", awserr.ErrNotFound) // ErrMissingMemberID is returned when the member ID is missing for a proposal. ErrMissingMemberID = errors.New("MemberId is required for CreateProposal") // ErrMissingVoterMemberID is returned when the voter member ID is missing for VoteOnProposal. ErrMissingVoterMemberID = errors.New("VoterMemberId is required for VoteOnProposal") // ErrMissingNodeMemberID is returned when MemberId is missing for a node operation. Real AWS // documents MemberId as "required for Hyperledger Fabric" on every node op (CreateNode's body // field, GetNode/ListNodes/DeleteNode/UpdateNode's "memberId" query parameter); gopherstack // only emulates Hyperledger Fabric networks, so it is always required here. ErrMissingNodeMemberID = errors.New("MemberId is required for Hyperledger Fabric node operations") // ErrMissingMemberFrameworkConfig is returned when MemberConfiguration.FrameworkConfiguration // is missing. The real aws-sdk-go-v2 client-side validator (validateMemberConfiguration) // requires this field on both CreateNetwork's and CreateMember's MemberConfiguration. ErrMissingMemberFrameworkConfig = errors.New("FrameworkConfiguration is required for member configuration") // ErrMissingMemberFabricConfig is returned when MemberConfiguration.FrameworkConfiguration.Fabric // is missing. gopherstack only emulates Hyperledger Fabric networks (see ErrMissingNodeMemberID), // so unlike the real API (which permits an empty FrameworkConfiguration for future frameworks), // Fabric is always required here. ErrMissingMemberFabricConfig = errors.New( "FrameworkConfiguration.Fabric is required for Hyperledger Fabric member configuration", ) // ErrMissingMemberAdminUsername is returned when Fabric.AdminUsername is missing. Real AWS's // client-side validator (validateMemberFabricConfiguration) requires this field. ErrMissingMemberAdminUsername = errors.New("AdminUsername is required for member's Fabric configuration") // ErrMissingMemberAdminPassword is returned when Fabric.AdminPassword is missing. Real AWS's // client-side validator (validateMemberFabricConfiguration) requires this field. ErrMissingMemberAdminPassword = errors.New("AdminPassword is required for member's Fabric configuration") // ErrInvalidMemberAdminPassword is returned when Fabric.AdminPassword does not meet the real // API's documented length constraint (8-32 characters). ErrInvalidMemberAdminPassword = errors.New("AdminPassword must be between 8 and 32 characters") // ErrMissingNetworkFabricEdition is returned when FrameworkConfiguration.Fabric is present but // Edition is missing. Real AWS's client-side validator (validateNetworkFabricConfiguration) // requires this field whenever a Fabric configuration object is supplied. ErrMissingNetworkFabricEdition = errors.New( "FrameworkConfiguration.Fabric.Edition is required when Fabric is specified", ) // ErrUnsupportedNetworkFramework is returned when Framework is set to a value other than // HYPERLEDGER_FABRIC. Real AWS's CreateNetwork documents itself as "Applies only to // Hyperledger Fabric" -- new networks (including ETHEREUM, still a valid Framework enum // member used elsewhere, e.g. accessors) can no longer be created through this operation. ErrUnsupportedNetworkFramework = errors.New("CreateNetworkInput.Framework must be HYPERLEDGER_FABRIC") // ErrValidation is returned when input validation fails. ErrValidation = awserr.New("InvalidRequestException: validation error", awserr.ErrInvalidParameter) )
var ErrNilAppContext = errors.New("managedblockchain: AppContext must not be nil")
ErrNilAppContext is returned when Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type Accessor ¶
type Accessor struct {
CreationDate *time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
Arn string `json:"arn"`
BillingToken string `json:"billingToken"`
ID string `json:"id"`
NetworkType string `json:"networkType"`
Status string `json:"status"`
Type string `json:"type"`
}
Accessor represents an Amazon Managed Blockchain accessor for token-based access.
type ApprovalThresholdPolicy ¶
type ApprovalThresholdPolicy struct {
ThresholdComparator string `json:"thresholdComparator,omitempty"`
ProposalDurationInHours int32 `json:"proposalDurationInHours,omitempty"`
ThresholdPercentage int32 `json:"thresholdPercentage,omitempty"`
}
ApprovalThresholdPolicy defines the threshold for proposal approval.
type CloudWatchLogState ¶
type CloudWatchLogState struct {
Enabled bool `json:"enabled"`
}
CloudWatchLogState stores CloudWatch logging state.
type ExportedMember ¶
type ExportedMember = Member
ExportedMember is a compatibility alias used by the dashboard package.
type ExportedNetwork ¶
type ExportedNetwork = Network
ExportedNetwork is a compatibility alias used by the dashboard package.
type Handler ¶
type Handler struct {
Backend StorageBackend
AccountID string
DefaultRegion string
}
Handler is the HTTP handler for the Managed Blockchain REST API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Managed Blockchain handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource ID from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported Managed Blockchain operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Managed Blockchain requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset implements service.Resettable by delegating to the backend.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Managed Blockchain REST API requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
networks, members, nodes, accessors, proposals, proposalVotes, and invitations are all *store.Table (Phase 3.3 of the datalayer refactor); see store_setup.go for their key functions, indexes, and registration. arnToResource remains a plain map -- see store_setup.go's doc comment for why it cannot become a store.Table.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates a new in-memory Managed Blockchain backend.
func (*InMemoryBackend) AddAccessorInternal ¶
func (b *InMemoryBackend) AddAccessorInternal(region, accountID, accessorType, networkType string) *Accessor
AddAccessorInternal adds an accessor directly to the backend (for testing and seeding).
func (*InMemoryBackend) AddInvitationInternal ¶
func (b *InMemoryBackend) AddInvitationInternal(region, accountID, networkID, networkName string) *Invitation
AddInvitationInternal adds an invitation directly to the backend (for testing and seeding).
func (*InMemoryBackend) AddMemberInternal ¶
func (b *InMemoryBackend) AddMemberInternal(region, accountID, networkID, name string) *Member
AddMemberInternal adds a member directly to the backend (for testing and seeding). The network must already exist.
func (*InMemoryBackend) AddNetworkInternal ¶
func (b *InMemoryBackend) AddNetworkInternal(region, accountID, name string) *Network
AddNetworkInternal adds a network directly to the backend (for testing and seeding).
func (*InMemoryBackend) AddNodeInternal ¶
func (b *InMemoryBackend) AddNodeInternal(region, accountID, networkID, memberID, instanceType string) *Node
AddNodeInternal adds a node directly to the backend (for testing and seeding). The network and member must already exist.
func (*InMemoryBackend) AddProposalInternal ¶
func (b *InMemoryBackend) AddProposalInternal(region, accountID, networkID, memberID, description string) *Proposal
AddProposalInternal adds a proposal directly to the backend (for testing and seeding). The network and member must already exist.
func (*InMemoryBackend) CreateAccessor ¶
func (b *InMemoryBackend) CreateAccessor( region, accountID, accessorType, networkType string, tags map[string]string, ) (*Accessor, error)
CreateAccessor creates a new accessor for token-based access.
func (*InMemoryBackend) CreateMember ¶
func (b *InMemoryBackend) CreateMember( region, accountID, networkID, name, description, adminUsername, kmsKeyArn string, tags map[string]string, ) (*Member, error)
CreateMember creates a new member in an existing network.
func (*InMemoryBackend) CreateNetwork ¶
func (b *InMemoryBackend) CreateNetwork( region, accountID, name, description, framework, frameworkVersion, memberName, memberDescription string, tags map[string]string, votingPolicy *VotingPolicy, fabricEdition, memberAdminUsername, memberKmsKeyArn string, ) (*Network, *Member, error)
CreateNetwork creates a new Managed Blockchain network and its first member.
func (*InMemoryBackend) CreateNode ¶
func (b *InMemoryBackend) CreateNode( region, accountID, networkID, memberID, instanceType, availabilityZone, stateDB string, tags map[string]string, ) (*Node, error)
CreateNode creates a new peer node within a member. The node's KmsKeyArn is inherited from its owning member, matching real AWS ("The node inherits this parameter from the member that it belongs to.").
func (*InMemoryBackend) CreateProposal ¶
func (b *InMemoryBackend) CreateProposal( region, accountID, networkID, memberID, description string, actions *ProposalActions, tags map[string]string, ) (*Proposal, error)
CreateProposal creates a new governance proposal on a network.
func (*InMemoryBackend) DeleteAccessor ¶
func (b *InMemoryBackend) DeleteAccessor(accessorID string) error
DeleteAccessor removes an accessor.
func (*InMemoryBackend) DeleteMember ¶
func (b *InMemoryBackend) DeleteMember(networkID, memberID string) error
DeleteMember removes a member from a network, cascading the delete to all of its nodes.
func (*InMemoryBackend) DeleteNode ¶
func (b *InMemoryBackend) DeleteNode(networkID, memberID, nodeID string) error
DeleteNode removes a node from a member.
func (*InMemoryBackend) GetAccessor ¶
func (b *InMemoryBackend) GetAccessor(accessorID string) (*Accessor, error)
GetAccessor returns an accessor by ID.
func (*InMemoryBackend) GetMember ¶
func (b *InMemoryBackend) GetMember(networkID, memberID string) (*Member, error)
GetMember returns a member by network ID and member ID.
func (*InMemoryBackend) GetNetwork ¶
func (b *InMemoryBackend) GetNetwork(networkID string) (*Network, error)
GetNetwork returns the details of a network by ID.
func (*InMemoryBackend) GetNode ¶
func (b *InMemoryBackend) GetNode(networkID, memberID, nodeID string) (*Node, error)
GetNode returns a node by network ID, member ID, and node ID.
func (*InMemoryBackend) GetProposal ¶
func (b *InMemoryBackend) GetProposal(networkID, proposalID string) (*Proposal, error)
GetProposal returns a proposal by network ID and proposal ID.
func (*InMemoryBackend) ListAccessors ¶
func (b *InMemoryBackend) ListAccessors(filter ListAccessorsFilter) ([]*Accessor, error)
ListAccessors returns all accessors sorted by ID, optionally filtered.
func (*InMemoryBackend) ListInvitations ¶
func (b *InMemoryBackend) ListInvitations() ([]*Invitation, error)
ListInvitations returns all invitations sorted by invitation ID.
func (*InMemoryBackend) ListMembers ¶
func (b *InMemoryBackend) ListMembers(networkID string, filter ListMembersFilter) ([]*Member, error)
ListMembers returns all members in a network, optionally filtered.
func (*InMemoryBackend) ListNetworks ¶
func (b *InMemoryBackend) ListNetworks(filter ListNetworksFilter) ([]*Network, error)
ListNetworks returns all networks, optionally filtered.
func (*InMemoryBackend) ListNodes ¶
func (b *InMemoryBackend) ListNodes(networkID, memberID string, filter ListNodesFilter) ([]*Node, error)
ListNodes returns all nodes for a member sorted by ID, optionally filtered.
func (*InMemoryBackend) ListProposalVotes ¶
func (b *InMemoryBackend) ListProposalVotes(networkID, proposalID string) ([]*ProposalVote, error)
ListProposalVotes returns all votes for a proposal.
func (*InMemoryBackend) ListProposals ¶
func (b *InMemoryBackend) ListProposals(networkID, statusFilter string) ([]*Proposal, error)
ListProposals returns all proposals for a network sorted by proposal ID. statusFilter, when non-empty, limits results to proposals with that status.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns tags for a resource identified by ARN.
func (*InMemoryBackend) RejectInvitation ¶
func (b *InMemoryBackend) RejectInvitation(invitationID string) error
RejectInvitation rejects an invitation by setting its status to REJECTED.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds or updates tags on a resource.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a resource.
func (*InMemoryBackend) UpdateMember ¶
func (b *InMemoryBackend) UpdateMember( networkID, memberID string, logConfig *MemberLogPublishingConfigState, ) (*Member, error)
UpdateMember updates a member's log publishing configuration.
func (*InMemoryBackend) UpdateNode ¶
func (b *InMemoryBackend) UpdateNode( networkID, memberID, nodeID string, logConfig *NodeLogPublishingConfigState, ) (*Node, error)
UpdateNode updates a node's log publishing configuration.
func (*InMemoryBackend) VoteOnProposal ¶
func (b *InMemoryBackend) VoteOnProposal(networkID, proposalID, memberID, vote string) error
VoteOnProposal records a YES or NO vote on a proposal and transitions its status when threshold met.
type Invitation ¶
type Invitation struct {
NetworkSummary *InvitationNetworkSummary `json:"networkSummary,omitempty"`
CreationDate *time.Time `json:"creationDate"`
ExpirationDate *time.Time `json:"expirationDate,omitempty"`
Arn string `json:"arn"`
InvitationID string `json:"invitationId"`
NetworkID string `json:"networkId"`
NetworkName string `json:"networkName"`
Status string `json:"status"`
}
Invitation represents an invitation to join a Managed Blockchain network.
type InvitationNetworkSummary ¶
type InvitationNetworkSummary struct {
CreationDate *time.Time `json:"creationDate,omitempty"`
Arn string `json:"arn,omitempty"`
Description string `json:"description,omitempty"`
Framework string `json:"framework,omitempty"`
FrameworkVersion string `json:"frameworkVersion,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
}
InvitationNetworkSummary is a summary of the network included in an Invitation.
type InviteAction ¶
type InviteAction struct {
Principal string `json:"principal"`
}
InviteAction represents an invitation to an AWS account to join the network.
type ListAccessorsFilter ¶
type ListAccessorsFilter struct {
NetworkType string
}
ListAccessorsFilter contains optional filters for ListAccessors.
type ListMembersFilter ¶
ListMembersFilter contains optional filters for ListMembers.
type ListNetworksFilter ¶
ListNetworksFilter contains optional filters for ListNetworks.
type ListNodesFilter ¶
type ListNodesFilter struct {
Status string
}
ListNodesFilter contains optional filters for ListNodes.
type LogConfigState ¶
type LogConfigState struct {
CloudWatch *CloudWatchLogState `json:"cloudWatch,omitempty"`
}
LogConfigState stores whether logging is enabled.
type Member ¶
type Member struct {
CreationDate *time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
LogPublishingConfiguration *MemberLogPublishingConfigState `json:"logPublishingConfiguration,omitempty"`
FrameworkAttributes *MemberFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
Arn string `json:"arn"`
Description string `json:"description"`
ID string `json:"id"`
KmsKeyArn string `json:"kmsKeyArn,omitempty"`
Name string `json:"name"`
NetworkID string `json:"networkID"`
Status string `json:"status"`
IsOwned bool `json:"isOwned"`
}
Member represents a member within a Managed Blockchain network.
type MemberFabricAttributesState ¶ added in v1.2.0
type MemberFabricAttributesState struct {
AdminUsername string `json:"adminUsername,omitempty"`
CaEndpoint string `json:"caEndpoint,omitempty"`
}
MemberFabricAttributesState holds Hyperledger Fabric-specific member attributes.
type MemberFabricLogState ¶
type MemberFabricLogState struct {
CALogs *LogConfigState `json:"caLogs,omitempty"`
}
MemberFabricLogState stores Fabric-specific log config for a member.
type MemberFrameworkAttributesState ¶ added in v1.2.0
type MemberFrameworkAttributesState struct {
Fabric *MemberFabricAttributesState `json:"fabric,omitempty"`
}
MemberFrameworkAttributesState holds framework-specific member attributes. Only Fabric is modeled -- see Network.FrameworkAttributes' doc comment.
type MemberLogPublishingConfigState ¶
type MemberLogPublishingConfigState struct {
Fabric *MemberFabricLogState `json:"fabric,omitempty"`
}
MemberLogPublishingConfigState stores log publishing configuration for a member.
type MemberSummary ¶
type MemberSummary struct {
CreationDate *time.Time `json:"creationDate"`
Arn string `json:"arn"`
Description string `json:"description"`
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
IsOwned bool `json:"isOwned"`
}
MemberSummary is the short form returned by ListMembers.
type Network ¶
type Network struct {
CreationDate *time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
VotingPolicy *VotingPolicy `json:"votingPolicy,omitempty"`
FrameworkAttributes *NetworkFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
Arn string `json:"arn"`
Description string `json:"description"`
Framework string `json:"framework"`
FrameworkVersion string `json:"frameworkVersion"`
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
VpcEndpointServiceName string `json:"vpcEndpointServiceName,omitempty"`
}
Network represents an Amazon Managed Blockchain network.
type NetworkFabricAttributesState ¶ added in v1.2.0
type NetworkFabricAttributesState struct {
Edition string `json:"edition,omitempty"`
OrderingServiceEndpoint string `json:"orderingServiceEndpoint,omitempty"`
}
NetworkFabricAttributesState holds Hyperledger Fabric-specific network attributes.
type NetworkFrameworkAttributesState ¶ added in v1.2.0
type NetworkFrameworkAttributesState struct {
Fabric *NetworkFabricAttributesState `json:"fabric,omitempty"`
}
NetworkFrameworkAttributesState holds framework-specific network attributes. gopherstack only emulates the Hyperledger Fabric framework (CreateNetwork's real API also documents itself as "Applies only to Hyperledger Fabric" -- new networks can no longer be created on the Ethereum framework), so only Fabric is modeled; the real API's sibling Ethereum field is intentionally omitted here since gopherstack never populates it.
type NetworkSummary ¶
type NetworkSummary struct {
CreationDate *time.Time `json:"creationDate"`
Arn string `json:"arn"`
Description string `json:"description"`
Framework string `json:"framework"`
FrameworkVersion string `json:"frameworkVersion"`
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
}
NetworkSummary is the short form returned by ListNetworks.
type Node ¶
type Node struct {
CreationDate *time.Time `json:"creationDate"`
Tags map[string]string `json:"tags"`
LogPublishingConfiguration *NodeLogPublishingConfigState `json:"logPublishingConfiguration,omitempty"`
FrameworkAttributes *NodeFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
Arn string `json:"arn"`
AvailabilityZone string `json:"availabilityZone"`
ID string `json:"id"`
InstanceType string `json:"instanceType"`
KmsKeyArn string `json:"kmsKeyArn,omitempty"`
MemberID string `json:"memberID"`
NetworkID string `json:"networkID"`
StateDB string `json:"stateDB,omitempty"`
Status string `json:"status"`
}
Node represents a peer node within a Managed Blockchain member.
type NodeFabricAttributesState ¶ added in v1.2.0
type NodeFabricAttributesState struct {
PeerEndpoint string `json:"peerEndpoint,omitempty"`
PeerEventEndpoint string `json:"peerEventEndpoint,omitempty"`
}
NodeFabricAttributesState holds Hyperledger Fabric-specific node attributes.
type NodeFabricLogState ¶
type NodeFabricLogState struct {
ChaincodeLogs *LogConfigState `json:"chaincodeLogs,omitempty"`
PeerLogs *LogConfigState `json:"peerLogs,omitempty"`
}
NodeFabricLogState stores Fabric-specific log config for a node.
type NodeFrameworkAttributesState ¶ added in v1.2.0
type NodeFrameworkAttributesState struct {
Fabric *NodeFabricAttributesState `json:"fabric,omitempty"`
}
NodeFrameworkAttributesState holds framework-specific node attributes. Only Fabric is modeled -- see Network.FrameworkAttributes' doc comment; gopherstack's nodes always belong to a Fabric member (CreateNode requires MemberId, see ErrMissingNodeMemberID), so the real API's sibling Ethereum field is intentionally omitted here since gopherstack never populates it.
type NodeLogPublishingConfigState ¶
type NodeLogPublishingConfigState struct {
Fabric *NodeFabricLogState `json:"fabric,omitempty"`
}
NodeLogPublishingConfigState stores log publishing configuration for a node.
type NodeSummary ¶
type NodeSummary struct {
CreationDate *time.Time `json:"creationDate"`
Arn string `json:"arn"`
AvailabilityZone string `json:"availabilityZone,omitempty"`
ID string `json:"id"`
InstanceType string `json:"instanceType"`
Status string `json:"status"`
}
NodeSummary is the short form returned by ListNodes.
type Proposal ¶
type Proposal struct {
Actions *ProposalActions `json:"actions,omitempty"`
CreationDate *time.Time `json:"creationDate"`
ExpirationDate *time.Time `json:"expirationDate,omitempty"`
Tags map[string]string `json:"tags"`
Arn string `json:"arn"`
Description string `json:"description"`
NetworkID string `json:"networkId"`
ProposalID string `json:"proposalId"`
ProposedByMemberID string `json:"proposedByMemberId"`
ProposedByMemberName string `json:"proposedByMemberName"`
Status string `json:"status"`
NoVoteCount int `json:"noVoteCount"`
OutstandingVoteCount int `json:"outstandingVoteCount"`
YesVoteCount int `json:"yesVoteCount"`
}
Proposal represents a governance proposal on a Managed Blockchain network.
type ProposalActions ¶
type ProposalActions struct {
Invitations []InviteAction `json:"invitations,omitempty"`
Removals []RemoveAction `json:"removals,omitempty"`
}
ProposalActions defines the actions taken when a proposal is approved.
type ProposalVote ¶
type ProposalVote struct {
MemberID string `json:"memberId"`
MemberName string `json:"memberName"`
Vote string `json:"vote"`
// contains filtered or unexported fields
}
ProposalVote represents a single vote cast on a proposal.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Managed Blockchain service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Managed Blockchain service backend and handler.
type RemoveAction ¶
type RemoveAction struct {
MemberID string `json:"memberId"`
}
RemoveAction represents a removal of a member from the network.
type StorageBackend ¶
type StorageBackend interface {
CreateNetwork(
region, accountID, name, description, framework, frameworkVersion, memberName, memberDescription string,
tags map[string]string,
votingPolicy *VotingPolicy,
fabricEdition, memberAdminUsername, memberKmsKeyArn string,
) (*Network, *Member, error)
GetNetwork(networkID string) (*Network, error)
ListNetworks(filter ListNetworksFilter) ([]*Network, error)
CreateMember(
region, accountID, networkID, name, description, adminUsername, kmsKeyArn string,
tags map[string]string,
) (*Member, error)
GetMember(networkID, memberID string) (*Member, error)
ListMembers(networkID string, filter ListMembersFilter) ([]*Member, error)
DeleteMember(networkID, memberID string) error
CreateNode(
region, accountID, networkID, memberID, instanceType, availabilityZone, stateDB string,
tags map[string]string,
) (*Node, error)
GetNode(networkID, memberID, nodeID string) (*Node, error)
ListNodes(networkID, memberID string, filter ListNodesFilter) ([]*Node, error)
DeleteNode(networkID, memberID, nodeID string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
TagResource(resourceARN string, tags map[string]string) error
UntagResource(resourceARN string, tagKeys []string) error
CreateAccessor(region, accountID, accessorType, networkType string, tags map[string]string) (*Accessor, error)
GetAccessor(accessorID string) (*Accessor, error)
DeleteAccessor(accessorID string) error
ListAccessors(filter ListAccessorsFilter) ([]*Accessor, error)
CreateProposal(
region, accountID, networkID, memberID, description string,
actions *ProposalActions,
tags map[string]string,
) (*Proposal, error)
GetProposal(networkID, proposalID string) (*Proposal, error)
ListProposals(networkID, statusFilter string) ([]*Proposal, error)
ListProposalVotes(networkID, proposalID string) ([]*ProposalVote, error)
ListInvitations() ([]*Invitation, error)
RejectInvitation(invitationID string) error
UpdateMember(networkID, memberID string, logConfig *MemberLogPublishingConfigState) (*Member, error)
UpdateNode(networkID, memberID, nodeID string, logConfig *NodeLogPublishingConfigState) (*Node, error)
VoteOnProposal(networkID, proposalID, memberID, vote string) error
}
StorageBackend is the interface for the Managed Blockchain in-memory backend.
type VotingPolicy ¶
type VotingPolicy struct {
ApprovalThresholdPolicy *ApprovalThresholdPolicy `json:"approvalThresholdPolicy,omitempty"`
}
VotingPolicy defines how a network votes on proposals.
Source Files
¶
- accessors.go
- errors.go
- exports.go
- handler.go
- handler_accessors.go
- handler_invitations.go
- handler_members.go
- handler_networks.go
- handler_nodes.go
- handler_proposals.go
- handler_tags.go
- interfaces.go
- invitations.go
- members.go
- models.go
- networks.go
- nodes.go
- pagination.go
- persistence.go
- proposals.go
- provider.go
- store.go
- store_setup.go
- tags.go