26 lines
854 B
Go
26 lines
854 B
Go
|
package sigcred
|
||
|
|
||
|
import "dehub/typeobj"
|
||
|
|
||
|
// Credential represents a credential which has been attached to a commit which
|
||
|
// hopefully will allow it to be included in the master branch. Exactly one
|
||
|
// field tagged with "type" should be set.
|
||
|
type Credential struct {
|
||
|
PGPSignature *CredentialPGPSignature `type:"pgp_signature"`
|
||
|
|
||
|
// AccountID specifies the account which generated this Credential. The
|
||
|
// Credentials produced by the Signifier.Sign method do not fill this field
|
||
|
// in.
|
||
|
AccountID string `yaml:"account"`
|
||
|
}
|
||
|
|
||
|
// MarshalYAML implements the yaml.Marshaler interface.
|
||
|
func (c Credential) MarshalYAML() (interface{}, error) {
|
||
|
return typeobj.MarshalYAML(c)
|
||
|
}
|
||
|
|
||
|
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
||
|
func (c *Credential) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||
|
return typeobj.UnmarshalYAML(c, unmarshal)
|
||
|
}
|