Documentation ¶
Overview ¶
Package ticket provides functionality to work with MapR tickets, including parsing tickets either from their raw string representation or from Kubernetes secrets.
The package relies on https://pkg.go.dev/github.com/nobbs/mapr-ticket-parser for the actual ticket parsing. Most of the functionality in this package is just a wrapper around the parser to add some convenience methods.
Index ¶
- Constants
- func SecretContainsMaprTicket(secret *coreV1.Secret) bool
- type ErrSecretDoesNotContainMaprTicket
- type Ticket
- func (ticket *Ticket) AsMaprTicket() *parse.MaprTicket
- func (ticket *Ticket) CreationTime() time.Time
- func (ticket *Ticket) ExpirationTime() time.Time
- func (ticket *Ticket) ExpiresBefore(duration time.Duration) bool
- func (ticket *Ticket) GetCluster() string
- func (ticket *Ticket) GetUser() string
- func (ticket *Ticket) IsExpired() bool
Constants ¶
const ( // SecretMaprTicketKey is the key used for MapR tickets in secrets SecretMaprTicketKey = "CONTAINER_TICKET" // DefaultTimeFormat is the default time format used for human readable time strings DefaultTimeFormat = time.RFC3339 )
Variables ¶
This section is empty.
Functions ¶
func SecretContainsMaprTicket ¶
SecretContainsMaprTicket returns true if the secret contains the key typically used for MapR tickets
Types ¶
type ErrSecretDoesNotContainMaprTicket ¶
SecretContainsMaprTicket returns true if the secret contains the key typically used for MapR tickets
func NewErrSecretDoesNotContainMaprTicket ¶
func NewErrSecretDoesNotContainMaprTicket(namespace, name string) ErrSecretDoesNotContainMaprTicket
NewErrSecretDoesNotContainMaprTicket returns a new ErrSecretDoesNotContainMaprTicket
func (ErrSecretDoesNotContainMaprTicket) Error ¶
func (err ErrSecretDoesNotContainMaprTicket) Error() string
Error returns the error message for ErrSecretDoesNotContainMaprTicket
type Ticket ¶
type Ticket parse.MaprTicket
Wrapper around parse.Ticket to add methods
func NewMaprTicketFromBytes ¶ added in v0.4.0
NewMaprTicketFromBytes parses the ticket from the given bytes and returns it
func NewMaprTicketFromSecret ¶
NewMaprTicketFromSecret parses the ticket from the secret and returns it
func (*Ticket) AsMaprTicket ¶
func (ticket *Ticket) AsMaprTicket() *parse.MaprTicket
AsMaprTicket returns the ticket as a parse.MaprTicket object
func (*Ticket) CreationTime ¶
CreationTime returns the creation time of the ticket as a time.Time object
func (*Ticket) ExpirationTime ¶
ExpirationTime returns the expiry time of the ticket as a time.Time object
func (*Ticket) ExpiresBefore ¶
ExpiresBefore returns true if the ticket expires before the given duration
func (*Ticket) GetCluster ¶
GetCluster returns the cluster that the ticket is for