Documentation ¶
Index ¶
- type AzureKeyVaultClient
- type AzureKeyVaultClientConfig
- type AzureKeyVaultSecretResponse
- type DatasetIndexingOptions
- type DirectoryServer
- type DirectoryServerConfig
- type Node
- func (n *Node) HandshakeNetwork(directoryServerAddress, policyStoreAddress string) error
- func (n *Node) IfritAddress() string
- func (n *Node) IndexDataset(datasetId string, indexOptions *DatasetIndexingOptions) error
- func (n *Node) Name() string
- func (n *Node) RegisterDatasetHandler(f func(datasetId string, w http.ResponseWriter, r *http.Request))
- func (n *Node) RegisterMetadataHandler(f func(datasetId string, w http.ResponseWriter, r *http.Request))
- func (n *Node) RemoveDataset(id string)
- func (n *Node) Shutdown()
- func (n *Node) Start()
- func (n *Node) StartDatasetSyncing(remoteAddr string) error
- func (n *Node) String() string
- type NodeConfig
- type PolicyStore
- type PolicyStoreConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureKeyVaultClient ¶
type AzureKeyVaultClient struct {
// contains filtered or unexported fields
}
func NewAzureKeyVaultClient ¶
func NewAzureKeyVaultClient(config *AzureKeyVaultClientConfig) (*AzureKeyVaultClient, error)
func (*AzureKeyVaultClient) GetSecret ¶
func (k *AzureKeyVaultClient) GetSecret(vaultBaseURL, secretName string) (*AzureKeyVaultSecretResponse, error)
GetSecret retrieves a secret from keyvault
type AzureKeyVaultClientConfig ¶
type AzureKeyVaultClientConfig struct { AzureKeyVaultClientID string AzureKeyVaultClientSecret string AzureKeyVaultTenantID string }
Configuration required to use Azure Key Vault
type DatasetIndexingOptions ¶
type DatasetIndexingOptions struct {
AllowMultipleCheckouts bool
}
type DirectoryServer ¶
type DirectoryServer struct {
// contains filtered or unexported fields
}
func NewDirectoryServer ¶
func NewDirectoryServer(config *DirectoryServerConfig, new bool) (*DirectoryServer, error)
Returns a new DirectoryServer using the given directory server options. Returns a non-nil error, if any.
func (*DirectoryServer) Start ¶
func (d *DirectoryServer) Start()
Starts the directory server by running the Ifrit server, gRPC server and HTTP server. The call will return when these services have been started.
func (*DirectoryServer) Stop ¶
func (d *DirectoryServer) Stop()
Performs a graceful shutdown of the directory server.
type DirectoryServerConfig ¶
type DirectoryServerConfig struct { // The address of the CA. Default value is "127.0.0.1:8301" CaAddress string // The name of this node Name string // The database connection string. Default value is "". If it is not set, the database connection // will not be used. This means that only the in-memory maps will be used for storage. SQLConnectionString string // Backup retention time. Default value is 0. If it is zero, backup retentions will not be issued. // NOT USED BackupRetentionTime time.Time // Hostname of the node. Default value is "127.0.1.1". HostName string // Output directory of gossip observation unit. Default value is the current working directory. PolicyObserverWorkingDirectory string // HTTP port used by the server. Default value is 8080. HTTPPort int // TCP port used by the gRPC server. Default value is 8081. GRPCPort int // Path used to store X.509 certificate and private key CryptoUnitWorkingDirectory string // Ifrit's TCP port. Default value is 5000. IfritTCPPort int // Ifrit's UDP port. Default value is 6000. IfritUDPPort int }
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewNode ¶
func NewNode(config *NodeConfig, createNew bool) (*Node, error)
TODO: consider using intefaces
func (*Node) HandshakeNetwork ¶
func (*Node) IfritAddress ¶
Returns the underlying Ifrit address.
func (*Node) IndexDataset ¶
func (n *Node) IndexDataset(datasetId string, indexOptions *DatasetIndexingOptions) error
IndexDataset registers a dataset, given with its unique identifier. The call is blocking; it will return when policy requests to the policy store finish.
func (*Node) RegisterDatasetHandler ¶
func (n *Node) RegisterDatasetHandler(f func(datasetId string, w http.ResponseWriter, r *http.Request))
Registers a handler that processes the client request of datasets. The handler is only invoked if the same id was registered with 'func (n *Node) IndexDataset()' method. It is the caller's responsibility to close the request after use.
func (*Node) RegisterMetadataHandler ¶
func (n *Node) RegisterMetadataHandler(f func(datasetId string, w http.ResponseWriter, r *http.Request))
Registers a handler that processes the client request of metadata. The handler is only invoked if the same id was registered with 'func (n *Node) IndexDataset()' method. It is the caller's responsibility to close the request after use.
func (*Node) RemoveDataset ¶
Removes the dataset policy from the node. The dataset will no longer be available to clients.
func (*Node) StartDatasetSyncing ¶
type NodeConfig ¶
type NodeConfig struct { // The address of the CA. Default value is "127.0.0.1:8301" CaAddress string // The name of this node Name string // The database connection string. Default value is "". If it is not set, the database connection // will not be used. This means that only the in-memory maps will be used for storage. SQLConnectionString string // Backup retention time. Default value is 0. If it is zero, backup retentions will not be issued. // NOT USED BackupRetentionTime time.Time // Hostname of the node. Default value is "127.0.1.1". Hostname string // Output directory of gossip observation unit. Default value is the current working directory. PolicyObserverWorkingDirectory string // HTTP port number. Default value is 9000 Port int // Synchronization interval. Default value is 60 seconds. SyncInterval time.Duration // Path used to store X.509 certificate and private key CryptoUnitWorkingDirectory string }
type PolicyStore ¶
type PolicyStore struct {
// contains filtered or unexported fields
}
func NewPolicyStore ¶
func NewPolicyStore(config *PolicyStoreConfig, new bool) (*PolicyStore, error)
func (*PolicyStore) IfritAddress ¶
func (ps *PolicyStore) IfritAddress() string
func (*PolicyStore) RunPolicyBatcher ¶
func (ps *PolicyStore) RunPolicyBatcher()
func (*PolicyStore) Start ¶
func (ps *PolicyStore) Start() error
func (*PolicyStore) Stop ¶
func (ps *PolicyStore) Stop()
func (*PolicyStore) StopPolicyBatcher ¶
func (ps *PolicyStore) StopPolicyBatcher()
type PolicyStoreConfig ¶
type PolicyStoreConfig struct { // The address of the CA. Default value is "127.0.0.1:8301" CaAddress string // The name of this node Name string // The location of the Git repository. Default value is "./policy_store_repository". PolicyStoreGitRepository string // Hostname of the policy store. Default value is "127.0.1.1". Hostname string // Gossip interval in seconds. Default value is 60 seconds. GossipInterval time.Duration // HTTP port used by the http server. Default value is 8083 HTTPPort int // TCP port used by the gRPC server. Default value is 8084 GRPCPort int // Mutlicast acceptance level. Default value is 0.5. MulticastAcceptanceLevel float64 // Number of direct recipients. Default value is 1. NumDirectRecipients int // Directory server address. Default value is "127.0.1.1:8081". DirectoryServerAddress string // The address of the CA. Default value is "127.0.0.1:8301" LohpiCaAddr string // The database connection string. Default value is "". If it is not set, the database connection // will not be used. This means that only the in-memory maps will be used for storage. SQLConnectionString string // Path used to store X.509 certificate and private key CryptoUnitWorkingDirectory string // Ifrit's TCP port. Default value is 5000. IfritTCPPort int // Ifrit's UDP port. Default value is 6000. IfritUDPPort int // Ifrit's X.509 certificate path. An error is returned if the string is empty. IfritCertPath string }