Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderKey string = "Authorization" HeaderValuePattern = `^Bearer: .+$` HeaderValueFormat = "Bearer: %s" )
View Source
const ( URIScheme = "secret-token" URIPattern = `^secret-token:[a-zA-Z0-9\-._~%]+$` URIFormat string = "secret-token:%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecretToken ¶
type SecretToken struct {
// contains filtered or unexported fields
}
func New ¶
func New(token string) (SecretToken, error)
FromString creates a new SecretToken from a string, returning a new SecretToken instance or an error if invalid UTF-8 characters are present.
func NewFromBytes ¶
func NewFromBytes(token []byte) (SecretToken, error)
FromBytes creates a new SecretToken from a slice of bytes, returning a pointer to a SecretToken instance or an error if invalid UTF-8 characters are present.
func Parse ¶
func Parse(uri string) (SecretToken, error)
func ParseBytes ¶
func ParseBytes(uri []byte) (SecretToken, error)
func (SecretToken) Equals ¶
func (s SecretToken) Equals(s2 SecretToken) bool
Equals can be used to check if two SecretTokens match, using a constant-time comparison.
func (SecretToken) String ¶
func (s SecretToken) String() string
String can be used to generate a string representation of a SecretToken URI. Use Equals() to compare two SecretTokens
Click to show internal directories.
Click to hide internal directories.