本文整理匯總了Golang中github.com/letsencrypt/boulder/core.Registration.Status方法的典型用法代碼示例。如果您正苦於以下問題:Golang Registration.Status方法的具體用法?Golang Registration.Status怎麽用?Golang Registration.Status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/letsencrypt/boulder/core.Registration
的用法示例。
在下文中一共展示了Registration.Status方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: modelToRegistration
func modelToRegistration(ri interface{}) (core.Registration, error) {
var rm *regModelv1
if features.Enabled(features.AllowAccountDeactivation) {
r2 := ri.(*regModelv2)
rm = &r2.regModelv1
} else {
rm = ri.(*regModelv1)
}
k := &jose.JsonWebKey{}
err := json.Unmarshal(rm.Key, k)
if err != nil {
err = fmt.Errorf("unable to unmarshal JsonWebKey in db: %s", err)
return core.Registration{}, err
}
var contact *[]string
// Contact can be nil when the DB contains the literal string "null". We
// prefer to represent this in memory as a pointer to an empty slice rather
// than a nil pointer.
if rm.Contact == nil {
contact = &[]string{}
} else {
contact = &rm.Contact
}
r := core.Registration{
ID: rm.ID,
Key: k,
Contact: contact,
Agreement: rm.Agreement,
InitialIP: net.IP(rm.InitialIP),
CreatedAt: rm.CreatedAt,
}
if features.Enabled(features.AllowAccountDeactivation) {
r2 := ri.(*regModelv2)
r.Status = core.AcmeStatus(r2.Status)
}
return r, nil
}