Documentation
¶
Overview ¶
Copyright © 2020 AMIS Technologies
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 AMIS Technologies ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 AMIS Technologies ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cmd = &cobra.Command{ Use: "reshare", Short: "Reshare process", Long: `Refresh the secret share without changing the public key.`, RunE: func(cmd *cobra.Command, args []string) error { err := initService(cmd) if err != nil { log.Crit("Failed to init", "err", err) } c, err := readReshareConfigFile(configFile) if err != nil { log.Crit("Failed to read config file", "configFile", configFile, "err", err) } host, err := peer.MakeBasicHost(c.Port) if err != nil { log.Crit("Failed to create a basic host", "err", err) } pm := peer.NewPeerManager(utils.GetPeerIDFromPort(c.Port), host, reshareProtocol) err = pm.AddPeers(c.Peers) if err != nil { log.Crit("Failed to add peers", "err", err) } service, err := NewService(c, pm) if err != nil { log.Crit("Failed to new service", "err", err) } host.SetStreamHandler(reshareProtocol, func(s network.Stream) { service.Handle(s) }) pm.EnsureAllConnected() service.Process() return nil }, }
Functions ¶
func NewService ¶
func NewService(config *ReshareConfig, pm types.PeerManager) (*service, error)
Types ¶
type ReshareConfig ¶
type ReshareConfig struct {
}
type ReshareResult ¶
type ReshareResult struct {
}