client/somc/client.go
func (b *ClientBuilder) NewClient(somcType uint8, somcData data.Base64String) (Client, error) {
	if somcType == data.OfferingSOMCTor {
		hostnameBytes, err := data.ToBytes(somcData)
		if err != nil {
			return nil, err
		}
		torClient, err := tor.NewHTTPClient(b.torSocks)
		return somcsrv.NewClient(torClient, string(hostnameBytes)), nil
	}

	return nil, ErrUnknownSOMCType
}
func (b *ClientBuilder) NewClient(somcType uint8, somcData data.Base64String) (Client, error) {
	if somcType == data.OfferingSOMCTor {
		hostnameBytes, err := data.ToBytes(somcData)
		if err != nil {
			return nil, err
		}
		torClient, err := tor.NewHTTPClient(b.torSocks)
		return somcsrv.NewClient(torClient, string(hostnameBytes)), nil
	}

	return nil, ErrUnknownSOMCType
}
func ( b * ClientBuilder ) NewClient ( somcType uint8 , somcData data . Base64String ) ( Client , error ) { if somcType == data . OfferingSOMCTor { hostnameBytes , err := data . ToBytes ( somcData ) if err != nil { return nil , err } torClient , err := tor . NewHTTPClient ( b . torSocks ) return somcsrv . NewClient ( torClient , string ( hostnameBytes ) ) , nil } return nil , ErrUnknownSOMCType }
// NewClient returns new client instance based given somc type and data.
NewClient returns new client instance based given somc type and data .