Documentation ¶
Index ¶
- type ConfigService
- func (c *ConfigService) ConfigFileUsed() string
- func (c *ConfigService) GetBool(key string) bool
- func (c *ConfigService) GetDuration(key string) time.Duration
- func (c *ConfigService) GetInt(path string) int
- func (c *ConfigService) GetPath(key string) string
- func (c *ConfigService) GetString(key string) string
- func (c *ConfigService) GetStringSlice(key string) []string
- func (c *ConfigService) IsSet(key string) bool
- func (c *ConfigService) TranslatePath(path string) string
- func (c *ConfigService) UnmarshalKey(key string, rawVal interface{}) error
- type Context
- type EndpointService
- func (e *EndpointService) AddPublicKeyExtractor(publicKeyExtractor PublicKeyExtractor) error
- func (e *EndpointService) AddResolver(name string, domain string, addresses map[string]string, aliases []string, ...) (view.Identity, error)
- func (e *EndpointService) Bind(longTerm view.Identity, ephemeral view.Identity) error
- func (e *EndpointService) GetIdentity(label string, pkiID []byte) (view.Identity, error)
- func (e *EndpointService) IsBoundTo(a view.Identity, b view.Identity) bool
- func (e *EndpointService) Resolve(party view.Identity) (view.Identity, map[PortName]string, []byte, error)
- func (e *EndpointService) ResolveIdentities(endpoints ...string) ([]view.Identity, error)
- func (e *EndpointService) SetPublicKeyIDSynthesizer(publicKeyIDSynthesizer PublicKeyIDSynthesizer)
- type Factory
- type Identity
- type IdentityProvider
- type Manager
- func (m *Manager) Context(contextID string) (*Context, error)
- func (m *Manager) InitiateContext(view View) (*Context, error)
- func (m *Manager) InitiateContextFrom(ctx context.Context, view View, id view.Identity, contextID string) (*Context, error)
- func (m *Manager) InitiateContextWithIdentityAndID(view View, id view.Identity, contextID string) (view.Context, error)
- func (m *Manager) InitiateView(view View, ctx context.Context) (interface{}, error)
- func (m *Manager) NewView(id string, in []byte) (View, error)
- type PortName
- type PublicKeyExtractor
- type PublicKeyIDSynthesizer
- type Registry
- func (r *Registry) GetIdentifier(f View) string
- func (r *Registry) GetResponder(initiatedBy interface{}) (View, error)
- func (r *Registry) RegisterFactory(id string, factory Factory) error
- func (r *Registry) RegisterResponder(responder View, initiatedBy interface{}) error
- func (r *Registry) RegisterResponderWithIdentity(responder View, id view.Identity, initiatedBy interface{}) error
- type ServiceProvider
- type SigService
- func (s *SigService) GetAuditInfo(identity view.Identity) ([]byte, error)
- func (s *SigService) GetSigner(identity view.Identity) (Signer, error)
- func (s *SigService) GetSigningIdentity(identity view.Identity) (*SigningIdentity, error)
- func (s *SigService) GetVerifier(identity view.Identity) (Verifier, error)
- func (s *SigService) IsMe(identity view.Identity) bool
- func (s *SigService) RegisterAuditInfo(identity view.Identity, info []byte) error
- func (s *SigService) RegisterSigner(identity view.Identity, signer Signer, verifier Verifier) error
- func (s *SigService) RegisterVerifier(identity view.Identity, verifier Verifier) error
- type Signer
- type SigningIdentity
- type Verifier
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
ConfigService models a configuration registry
func GetConfigService ¶
func GetConfigService(sp ServiceProvider) *ConfigService
GetConfigService returns an instance of the config service. It panics, if no instance is found.
func (*ConfigService) ConfigFileUsed ¶
func (c *ConfigService) ConfigFileUsed() string
ConfigFileUsed returns the file used to populate the config registry
func (*ConfigService) GetBool ¶
func (c *ConfigService) GetBool(key string) bool
GetBool returns the value associated with the key asa boolean
func (*ConfigService) GetDuration ¶
func (c *ConfigService) GetDuration(key string) time.Duration
GetDuration returns the value associated with the key as a duration
func (*ConfigService) GetInt ¶
func (c *ConfigService) GetInt(path string) int
GetInt returns the value associated with the key as an integer
func (*ConfigService) GetPath ¶
func (c *ConfigService) GetPath(key string) string
GetPath allows configuration strings that specify a (config-file) relative path
func (*ConfigService) GetString ¶
func (c *ConfigService) GetString(key string) string
GetString returns the value associated with the key as a string
func (*ConfigService) GetStringSlice ¶
func (c *ConfigService) GetStringSlice(key string) []string
GetStringSlice returns the value associated with the key as a slice of strings
func (*ConfigService) IsSet ¶
func (c *ConfigService) IsSet(key string) bool
IsSet checks to see if the key has been set in any of the data locations
func (*ConfigService) TranslatePath ¶
func (c *ConfigService) TranslatePath(path string) string
TranslatePath translates the passed path relative to the config path
func (*ConfigService) UnmarshalKey ¶
func (c *ConfigService) UnmarshalKey(key string, rawVal interface{}) error
UnmarshalKey takes a single key and unmarshals it into a Struct
type EndpointService ¶
type EndpointService struct {
// contains filtered or unexported fields
}
EndpointService provides endpoint-related services
func GetEndpointService ¶
func GetEndpointService(sp ServiceProvider) *EndpointService
GetEndpointService returns an instance of the endpoint service. It panics, if no instance is found.
func NewEndpointService ¶ added in v0.4.0
func NewEndpointService(es driver.EndpointService) *EndpointService
func (*EndpointService) AddPublicKeyExtractor ¶ added in v0.4.0
func (e *EndpointService) AddPublicKeyExtractor(publicKeyExtractor PublicKeyExtractor) error
AddPublicKeyExtractor add a new PKI resolver
func (*EndpointService) AddResolver ¶
func (e *EndpointService) AddResolver(name string, domain string, addresses map[string]string, aliases []string, id []byte) (view.Identity, error)
AddResolver adds a resolver for tha passed parameters. The passed id can be retrieved by using the passed name in a call to GetIdentity method. The addresses can be retrieved by passing the identity in a call to Resolve. If a resolver is already bound to the passed name, then the passed identity is linked to the already existing identity. The already existing identity is returned
func (*EndpointService) Bind ¶
Bind associated a 'long term' identity to an 'ephemeral' one. In more general terms, Bind binds any identity to another.
func (*EndpointService) GetIdentity ¶
GetIdentity returns an identity bound to either the passed label or public-key identifier.
func (*EndpointService) Resolve ¶
func (e *EndpointService) Resolve(party view.Identity) (view.Identity, map[PortName]string, []byte, error)
Resolve returns the endpoints of the passed identity. If the passed identity does not have any endpoint set, the service checks if the passed identity is bound to another identity that is returned together with its endpoints and public-key identifier.
func (*EndpointService) ResolveIdentities ¶
func (e *EndpointService) ResolveIdentities(endpoints ...string) ([]view.Identity, error)
func (*EndpointService) SetPublicKeyIDSynthesizer ¶ added in v0.4.0
func (e *EndpointService) SetPublicKeyIDSynthesizer(publicKeyIDSynthesizer PublicKeyIDSynthesizer)
type Factory ¶
type Factory interface { // NewView returns an instance of the View interface build using the passed argument. NewView(in []byte) (view.View, error) }
Factory is used to create instances of the View interface
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
type IdentityProvider ¶
type IdentityProvider struct {
// contains filtered or unexported fields
}
IdentityProvider provides identity services
func GetIdentityProvider ¶
func GetIdentityProvider(sp ServiceProvider) *IdentityProvider
GetIdentityProvider returns an instance of the identity provider. It panics, if no instance is found.
func (*IdentityProvider) Admins ¶
func (i *IdentityProvider) Admins() []view.Identity
Admins returns the identities of the administrators
func (*IdentityProvider) Clients ¶
func (i *IdentityProvider) Clients() []view.Identity
Clients returns the identities of the clients that can invoke views on this node
func (*IdentityProvider) DefaultIdentity ¶
func (i *IdentityProvider) DefaultIdentity() view.Identity
DefaultIdentity returns the default identity
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the lifecycle of views and contexts
func GetManager ¶
func GetManager(sp ServiceProvider) *Manager
GetManager returns an instance of the view manager. It panics, if no instance is found.
func NewManager ¶ added in v0.4.0
func NewManager(m driver.ViewManager) *Manager
func (*Manager) Context ¶
Context returns the context associated to the passed id, an error if not context is found.
func (*Manager) InitiateContext ¶
InitiateContext initiates a new context for the passed view
func (*Manager) InitiateContextFrom ¶ added in v0.4.0
func (m *Manager) InitiateContextFrom(ctx context.Context, view View, id view.Identity, contextID string) (*Context, error)
InitiateContextFrom initiates a new context for the passed view, derived from the passed context
func (*Manager) InitiateContextWithIdentityAndID ¶ added in v0.2.0
func (m *Manager) InitiateContextWithIdentityAndID(view View, id view.Identity, contextID string) (view.Context, error)
InitiateContextWithIdentityAndID initiates
func (*Manager) InitiateView ¶
InitiateView invokes the passed view and returns the result produced by that view
type PortName ¶
type PortName string
PortName is the type variable for the socket ports
const ( // ListenPort is the port at which the FSC node might listen for some service ListenPort PortName = "Listen" // ViewPort is the port on which the View Service Server respond ViewPort PortName = "View" // P2PPort is the port on which the P2P Communication Layer respond P2PPort PortName = "P2P" )
type PublicKeyExtractor ¶ added in v0.4.0
type PublicKeyExtractor = driver.PublicKeyExtractor
PublicKeyExtractor extracts public keys from identities
type PublicKeyIDSynthesizer ¶ added in v0.4.0
type PublicKeyIDSynthesizer = driver.PublicKeyIDSynthesizer
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry keeps track of the available view and view factories
func GetRegistry ¶
func GetRegistry(sp ServiceProvider) *Registry
GetRegistry returns an instance of the view registry. It panics, if no instance is found.
func (*Registry) GetIdentifier ¶
GetIdentifier returns the identifier of the passed view
func (*Registry) GetResponder ¶
GetResponder returns the responder for the passed initiator.
func (*Registry) RegisterFactory ¶
RegisterFactory binds an id to a View Factory
func (*Registry) RegisterResponder ¶
RegisterResponder binds a responder to an initiator. The responder is the view that will be called when the initiator (initiatedBy) contacts the FSC node where this RegisterResponder is invoked. The argument initiatedBy can be a view or a view identifier. If a view is passed, its identifier is computed and used to register the responder.
func (*Registry) RegisterResponderWithIdentity ¶
func (r *Registry) RegisterResponderWithIdentity(responder View, id view.Identity, initiatedBy interface{}) error
RegisterResponderWithIdentity binds the pair <responder, id> to an initiator. The responder is the view that will be called when the initiator (initiatedBy) contacts the FSC node where this RegisterResponderWithIdentity is invoked. The argument initiatedBy can be a view or a view identifier. If a view is passed, its identifier is computed and used to register the responder.
type ServiceProvider ¶
type ServiceProvider interface { // GetService returns an instance of the given type GetService(v interface{}) (interface{}, error) }
ServiceProvider is used to return instances of a given type
type SigService ¶
type SigService struct {
// contains filtered or unexported fields
}
SigService models a repository of sign and verify keys.
func GetSigService ¶
func GetSigService(sp ServiceProvider) *SigService
GetSigService returns an instance of the sig service. It panics, if no instance is found.
func NewSigService ¶ added in v0.4.0
func NewSigService(sigService driver.SigService, sigRegistry driver.SigRegistry, auditRegistry driver.AuditRegistry) *SigService
func (*SigService) GetAuditInfo ¶
func (s *SigService) GetAuditInfo(identity view.Identity) ([]byte, error)
GetAuditInfo returns the audit info associated to the passed identity, nil if not found
func (*SigService) GetSigner ¶
func (s *SigService) GetSigner(identity view.Identity) (Signer, error)
GetSigner returns the signer bound to the passed identity
func (*SigService) GetSigningIdentity ¶
func (s *SigService) GetSigningIdentity(identity view.Identity) (*SigningIdentity, error)
GetSigningIdentity returns the signer identity bound to the passed identity
func (*SigService) GetVerifier ¶
func (s *SigService) GetVerifier(identity view.Identity) (Verifier, error)
GetVerifier returns the verifier bound to the passed identity
func (*SigService) IsMe ¶
func (s *SigService) IsMe(identity view.Identity) bool
IsMe returns true if a signer was ever registered for the passed identity
func (*SigService) RegisterAuditInfo ¶
func (s *SigService) RegisterAuditInfo(identity view.Identity, info []byte) error
RegisterAuditInfo binds the passed audit info to the passed identity
func (*SigService) RegisterSigner ¶
RegisterSigner binds the passed identity to the passed signer and verifier
func (*SigService) RegisterVerifier ¶
func (s *SigService) RegisterVerifier(identity view.Identity, verifier Verifier) error
RegisterVerifier binds the passed identity to the passed verifier
type Signer ¶
type Signer interface { // Sign signs message bytes and returns the signature or an error on failure. Sign(message []byte) ([]byte, error) }
Signer is an interface which wraps the Sign method.
type SigningIdentity ¶
type SigningIdentity struct {
// contains filtered or unexported fields
}
SigningIdentity models an identity that can sign, verify messages and whose public side can be serialized
func (*SigningIdentity) GetPublicVersion ¶
func (s *SigningIdentity) GetPublicVersion() *Identity
func (*SigningIdentity) Serialize ¶
func (s *SigningIdentity) Serialize() ([]byte, error)
Serialize returns the byte representation of the public side of this identity
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
core
|
|
id/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
manager/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
sdk
|
|
services
|
|
db/driver/badger/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
db/driver/unversioned/mocks
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
events/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
grpc/metricsfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
kvs/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
metrics/operations/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
server/web/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
server/web/middleware/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
server/web/mocks
Code generated by counterfeiter.
|
Code generated by counterfeiter. |