const validatedSubstringsSize … // MarshalJSON implements the json.Marshaler interface. func (bts BootstrapTokenString) MarshalJSON() ([]byte, error) { … } // UnmarshalJSON implements the json.Unmarshaller interface. func (bts *BootstrapTokenString) UnmarshalJSON(b []byte) error { … } // String returns the string representation of the BootstrapTokenString func (bts BootstrapTokenString) String() string { … } // NewBootstrapTokenString converts the given Bootstrap Token as a string // to the BootstrapTokenString object used for serialization/deserialization // and internal usage. It also automatically validates that the given token // is of the right format func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) { … } // NewBootstrapTokenStringFromIDAndSecret is a wrapper around NewBootstrapTokenString // that allows the caller to specify the ID and Secret separately func NewBootstrapTokenStringFromIDAndSecret(id, secret string) (*BootstrapTokenString, error) { … } // BootstrapTokenToSecret converts the given BootstrapToken object to its Secret representation that // may be submitted to the API Server in order to be stored. func BootstrapTokenToSecret(bt *BootstrapToken) *v1.Secret { … } // encodeTokenSecretData takes the token discovery object and an optional duration and returns the .Data for the Secret // now is passed in order to be able to used in unit testing func encodeTokenSecretData(token *BootstrapToken, now time.Time) map[string][]byte { … } // BootstrapTokenFromSecret returns a BootstrapToken object from the given Secret func BootstrapTokenFromSecret(secret *v1.Secret) (*BootstrapToken, error) { … }