Documentation
¶
Index ¶
- Constants
- Variables
- func NormalizeDNS1123(str string) (string, error)
- type Claim
- func (c *Claim) Accept()
- func (c *Claim) GetAnnotations() map[string]string
- func (c *Claim) GetClaimAt() time.Time
- func (c *Claim) GetDescription() string
- func (c *Claim) GetEmail() string
- func (c *Claim) GetEncryptType() encrypt.EncryptType
- func (c *Claim) GetLabels() map[string]string
- func (c *Claim) GetName() string
- func (c *Claim) GetNamespaces() []string
- func (c *Claim) GetServiceAccountName() (string, error)
- func (c *Claim) GetState() ClaimStatus
- func (c *Claim) GetSubject() string
- func (c *Claim) GetZipPassword() string
- func (c *Claim) Reject()
- func (c *Claim) SetZipPassword(password string)
- func (c *Claim) Validate() error
- type ClaimOption
- type ClaimRegisterEvent
- type ClaimStatus
- type ClaimValidationError
- type GPGEncryptOption
- type ZipEncryptOption
Constants ¶
View Source
const (
ClaimAnnotationPrefix = "cinderella/claim."
)
Variables ¶
View Source
var ( ErrorRequireNamespace = &ClaimValidationError{mes: "Require Namespace field", field: "Namespaces", errorType: "empty value"} ErrorRequireSubject = &ClaimValidationError{mes: "Require Subject field", field: "Subject", errorType: "empty value"} )
Functions ¶
Types ¶
type Claim ¶
type Claim struct { ClaimAt time.Time `json:"claim_date"` Description string `json:"description"` Email string `json:"email,omitempty" validate:"email"` EncryptType encrypt.EncryptType `json:"encrypt_type,omitempty"` Name string `json:"name,omitempty"` Namespaces []string `json:"namespace"` State ClaimStatus `json:"status"` Subject string `json:"subject,omitempty" validate:"required"` ZipEncryptOption `json:"zip_option,omitempty"` GPGEncryptOption `json:"gpg_option,omitempty"` AcceptedAt time.Time `json:"accepted_at,omitempty"` RejectedAt time.Time `json:"rejected_at,omitempty"` ExpredAt time.Time `json:"expred_at,omitempty"` }
TODO: implement period(制限時間)
func NewClaimBase ¶
func NewClaimBase(opts ...ClaimOption) *Claim
func (*Claim) GetAnnotations ¶
func (*Claim) GetClaimAt ¶
func (*Claim) GetDescription ¶
func (*Claim) GetEncryptType ¶
func (c *Claim) GetEncryptType() encrypt.EncryptType
func (*Claim) GetNamespaces ¶
func (*Claim) GetServiceAccountName ¶
func (*Claim) GetState ¶
func (c *Claim) GetState() ClaimStatus
func (*Claim) GetSubject ¶
type ClaimOption ¶
type ClaimOption interface {
Apply(*Claim)
}
type ClaimRegisterEvent ¶
type ClaimRegisterEvent struct {
// contains filtered or unexported fields
}
func (*ClaimRegisterEvent) EventAt ¶
func (e *ClaimRegisterEvent) EventAt() time.Time
func (*ClaimRegisterEvent) GetMessage ¶
func (e *ClaimRegisterEvent) GetMessage() string
func (*ClaimRegisterEvent) GetType ¶
func (e *ClaimRegisterEvent) GetType() audit.AuditType
type ClaimStatus ¶
type ClaimStatus string
const ( ClaimStatusAccepted ClaimStatus = "accepted" ClaimStatusRejected ClaimStatus = "rejected" ClaimStatusPending ClaimStatus = "pending" ClaimStatusExpired ClaimStatus = "expired" )
type ClaimValidationError ¶
type ClaimValidationError struct {
// contains filtered or unexported fields
}
func (*ClaimValidationError) Error ¶
func (err *ClaimValidationError) Error() string
func (*ClaimValidationError) Is ¶
func (err *ClaimValidationError) Is(e error) bool
type GPGEncryptOption ¶
type GPGEncryptOption struct {
PublicKey string `json:"-"`
}
type ZipEncryptOption ¶
type ZipEncryptOption struct {
ZipPassword string `json:"-"`
}
func WithZipEncryptOption ¶
func WithZipEncryptOption(opt ZipEncryptOption) ZipEncryptOption
func (ZipEncryptOption) Apply ¶
func (opt ZipEncryptOption) Apply(c *Claim)
Click to show internal directories.
Click to hide internal directories.