utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

*

  • Copyright 2020 Napptive *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • https://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationInfoToJSON

func ApplicationInfoToJSON(metadata entities.ApplicationInfo) (string, error)

ApplicationInfoToJSON converts an ApplicationInfo struct into a JSON

func CreateTestApplicationInfo

func CreateTestApplicationInfo() *entities.ApplicationInfo
func CreateTestApplicationInfoWithoutLogo() *entities.ApplicationInfo

func CreateTestApplicationMetadata

func CreateTestApplicationMetadata() *entities.ApplicationMetadata

func CreateTestJWTAuthIncomingContext

func CreateTestJWTAuthIncomingContext(username string, accountName string, accountAdmin bool) context.Context

CreateTestJWTAuthIncomingContext creates a test context with metadata as found after passing the interceptor.

func DecomposeApplicationID

func DecomposeApplicationID(applicationID string) (string, *entities.ApplicationID, error)

DecomposeApplicationID extracts the catalog URL, namespace, and application name from an application identifier in the form of: [catalogURL/]namespace/appName[:tag]

func GenerateRandomString

func GenerateRandomString(length int) (string, error)

GenerateRandomString is a method to generate a random string with a determinate length

func GetFile

func GetFile(relativeFileName string, files []*entities.FileInfo) []byte

getFile looks for a file by name in the array retrieved and returns the data or nil if the file does not exist

func IsMetadata

func IsMetadata(data []byte) (bool, *entities.ApplicationMetadata, error)

IsMetadata checks if the file is metadata file and returns it

func IsYamlFile

func IsYamlFile(filePath string) bool

check file extension and returns if is a yaml file

func RunIntegrationTests

func RunIntegrationTests(id string) bool

RunIntegrationTests checks whether integration tests should be executed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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