github.com/ipni/storetheindex@v0.8.30/assigner/config/init.go (about)

     1  package config
     2  
     3  import (
     4  	"io"
     5  
     6  	sticfg "github.com/ipni/storetheindex/config"
     7  )
     8  
     9  func Init(out io.Writer) (*Config, error) {
    10  	identity, err := sticfg.CreateIdentity(out)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	return InitWithIdentity(identity)
    16  }
    17  
    18  func InitWithIdentity(identity sticfg.Identity) (*Config, error) {
    19  	conf := &Config{
    20  		Version:    Version,
    21  		Assignment: NewAssignment(),
    22  		Bootstrap:  sticfg.NewBootstrap(),
    23  		Daemon:     NewDaemon(),
    24  		Identity:   identity,
    25  		Logging:    NewLogging(),
    26  	}
    27  
    28  	return conf, nil
    29  }