Documentation
¶
Index ¶
- func DecodeUserToken(jwtTokenString, jwtSecret string, rawPubKey []byte) (*platform.User, error)
- func GenerateNewJwtToken(key, customer, org string, tokenType platform.TokenType) (string, error)
- func GenerateRandomBytes(n int) (string, error)
- func GetKubernetesClient(kubernetesHost string) (c *kubernetes.Clientset, err error)
- type APIInfo
- type ObjectMeta
- type ServerInfo
- type ServerTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeUserToken ¶
DecodeUserToken decodes a jwtToken (HS256 and RS256) into a *platform.User
func GenerateNewJwtToken ¶
GenerateNewJwtToken creates a new user token to allow machine-to-machine interaction
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GetKubernetesClient ¶
func GetKubernetesClient(kubernetesHost string) (c *kubernetes.Clientset, err error)
GetKubernetesClient returns a new client to interact with the api server
Types ¶
type APIInfo ¶
type APIInfo interface {
ObjectMeta
ReleaseURL() *releaseURL
}
APIInfo exposes information about the git API
func NewAPIInfo ¶
func NewAPIInfo(gitAPIHost string, meta ObjectMeta) APIInfo
NewAPIInfo creates a new APIInfo
type ObjectMeta ¶
type ObjectMeta interface {
GetRepository() string
GetName() string
GetOwner() string
GetAuthUser() string
GetAuthToken() string
WithCredentials(authUser, authToken string) *objectMeta
}
ObjectMeta maps a namespace/resource as owner/repo where every object has an authentication source.
func NewObjectMeta ¶
func NewObjectMeta(name, owner string) ObjectMeta
NewObjectMeta generates a new ObjectMeta
type ServerInfo ¶
type ServerInfo interface {
ObjectMeta
GetCloneURL() *gitURL
}
ServerInfo exposes information about the git server
func NewServerInfo ¶
func NewServerInfo(gitServerAddr string, meta ObjectMeta) (ServerInfo, error)
NewServerInfo creates a new ServerInfo
type ServerTask ¶
type ServerTask interface {
ObjectMeta
BaseReleasePath() string
FullReleasePath() string
BaseRepoPath() string
FullRepoPath() string
InitRepository() (bool, error)
InitRelease(revision string) (bool, error)
RemoveBranchRef(refName string) error
WriteBranchRef(refPath, rev string) error
}
ServerTask allows starting administrative tasks on git repositories
func NewServerTask ¶
func NewServerTask(gitHome string, meta ObjectMeta) ServerTask
NewServerTask creates a new ServerTask