util

package
v0.9.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeUserToken

func DecodeUserToken(jwtTokenString, jwtSecret string, rawPubKey []byte) (*platform.User, error)

DecodeUserToken decodes a jwtToken (HS256 and RS256) into a *platform.User

func GenerateNewJwtToken

func GenerateNewJwtToken(key, customer, org string, tokenType platform.TokenType) (string, error)

GenerateNewJwtToken creates a new user token to allow machine-to-machine interaction

func GenerateRandomBytes

func GenerateRandomBytes(n int) (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL