Documentation ¶
Index ¶
- Constants
- Variables
- func CloudVirtualMachine(name, namespace, location string, ...) *infrastructure.CloudVirtualMachine
- func CountLines(s string) int
- func CreateTestKubeconfig(client *api.Client, organization string) (string, error)
- func GenerateED25519PrivateKey() (string, error)
- func GenerateRSAPrivateKey() (string, error)
- func KeyValueStore(name, project, location string) *storage.KeyValueStore
- func MustParseTime(format string, value string) time.Time
- func MySQL(name, project, location string) *storage.MySQL
- func NewGitInformationService() *gitInformationService
- func Postgres(name, project, location string) *storage.Postgres
- func Projects(organization string, names ...string) []client.Object
- func SetupClient(opts ...ClientSetupOption) (*api.Client, error)
- type ClientSetupOption
- func WithDefaultProject(project string) ClientSetupOption
- func WithInterceptorFuncs(f interceptor.Funcs) ClientSetupOption
- func WithKubeconfig(t *testing.T) ClientSetupOption
- func WithNameIndexFor(obj runtime.Object) ClientSetupOption
- func WithObjects(objects ...client.Object) ClientSetupOption
- func WithOrganization(org string) ClientSetupOption
- func WithProjects(projects ...string) ClientSetupOption
- func WithProjectsFromResources(resources ...client.Object) ClientSetupOption
- type GitInfoServiceParsed
- type GitInformationServiceResponse
- type VerifyRequestFunc
Constants ¶
const ( DefaultProject = "default" FakeJWTToken = "" /* 335-byte string literal not displayed */ )
Variables ¶
var ( // TODO: would be nice to get this from "github.com/ninech/apis/apps/v1alpha1" AppSizeNotSet apps.ApplicationSize = "" AppMicro apps.ApplicationSize = "micro" AppMini apps.ApplicationSize = "mini" AppStandard1 apps.ApplicationSize = "standard-1" StatusSuperseded apps.ReleaseProcessStatus = "superseded" StatusAvailable apps.ReleaseProcessStatus = "available" )
Functions ¶
func CloudVirtualMachine ¶ added in v1.5.0
func CloudVirtualMachine(name, namespace, location string, powerstate infrastructure.VirtualMachinePowerState) *infrastructure.CloudVirtualMachine
func CountLines ¶
func CreateTestKubeconfig ¶
CreateTestKubeconfig creates a test kubeconfig which contains a nctl extension config with the given organization
func GenerateED25519PrivateKey ¶ added in v1.3.0
GenerateED25519PrivateKey generates an ED25519 private key
func GenerateRSAPrivateKey ¶ added in v1.3.0
GenerateRSAPrivateKey generates an RSA private key
func KeyValueStore ¶ added in v1.4.0
func KeyValueStore(name, project, location string) *storage.KeyValueStore
func NewGitInformationService ¶ added in v1.3.0
func NewGitInformationService() *gitInformationService
NewGitInformationService returns a new git information service mock. It can be used to verify requests sent to it and also to just return with a previously set response.
func SetupClient ¶
func SetupClient(opts ...ClientSetupOption) (*api.Client, error)
Types ¶
type ClientSetupOption ¶ added in v1.7.6
type ClientSetupOption func(*clientSetup)
func WithDefaultProject ¶ added in v1.7.6
func WithDefaultProject(project string) ClientSetupOption
WithDefaultProject sets the default project of the client
func WithInterceptorFuncs ¶ added in v1.7.6
func WithInterceptorFuncs(f interceptor.Funcs) ClientSetupOption
func WithKubeconfig ¶ added in v1.7.6
func WithKubeconfig(t *testing.T) ClientSetupOption
WithKubeconfig creates a fake kubeconfig which gets removed once the passed test finished
func WithNameIndexFor ¶ added in v1.7.6
func WithNameIndexFor(obj runtime.Object) ClientSetupOption
WithNameIndexFor adds a name index to the fake client set for the passed object type
func WithObjects ¶ added in v1.7.6
func WithObjects(objects ...client.Object) ClientSetupOption
WithObjects sets the objects which can be returned from the client
func WithOrganization ¶ added in v1.7.6
func WithOrganization(org string) ClientSetupOption
WithOrganization sets the organization of the client
func WithProjects ¶ added in v1.7.6
func WithProjects(projects ...string) ClientSetupOption
WithProjects exclusively sets the projects which should be created
func WithProjectsFromResources ¶ added in v1.7.6
func WithProjectsFromResources(resources ...client.Object) ClientSetupOption
WithProjectsFromResources reads the namespaces of all given resources and adds them (unique) to the clientSetups project list. Use this on your own risk in combination with `WithProjects`. Make make sure that `WithProjects` is set before this function call in a functional options list. Otherwise you will overwrite the results from this function.
type GitInfoServiceParsed ¶ added in v1.3.0
type GitInfoServiceParsed struct { Token string Method string Request apps.GitExploreRequest }
GitInfoServiceParsed represents are parsed request received by the git information service
type GitInformationServiceResponse ¶ added in v1.3.0
type GitInformationServiceResponse struct { // Code is the status code to be set Code int // Content describes the GitExploreResponse to be returned. Content apps.GitExploreResponse // Raw allows to return any text instead of a real GitExploreResponse. // If it is set, it has precedence over the Content field. Raw *string }
GitInformationServiceResponse describes a response of the git information service
type VerifyRequestFunc ¶ added in v1.3.0
type VerifyRequestFunc func(p GitInfoServiceParsed, err error)
VerifyRequestFunc can be used to verify the parsed request which was sent to the git information service