mirror of
https://github.com/go-i2p/go-sam-go.git
synced 2025-07-01 05:21:59 -04:00
26 lines
620 B
Go
26 lines
620 B
Go
// package sam3 wraps the original sam3 API from github.com/go-i2p/sam3
|
|
package sam3
|
|
|
|
type SAMResolver struct {
|
|
*SAM
|
|
}
|
|
|
|
func NewSAMResolver(parent *SAM) (*SAMResolver, error) {
|
|
log.Debug("Creating new SAMResolver from existing SAM instance")
|
|
var s SAMResolver
|
|
s.SAM = parent
|
|
return &s, nil
|
|
}
|
|
|
|
func NewFullSAMResolver(address string) (*SAMResolver, error) {
|
|
log.WithField("address", address).Debug("Creating new full SAMResolver")
|
|
var s SAMResolver
|
|
var err error
|
|
s.SAM, err = NewSAM(address)
|
|
if err != nil {
|
|
log.WithError(err).Error("Failed to create new SAM instance")
|
|
return nil, err
|
|
}
|
|
return &s, nil
|
|
}
|