logarea

package
v0.0.0-...-44c4069 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright Axis Communications AB.

For a full list of individual contributors, please see the commit history.

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

http://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.

Copyright Axis Communications AB.

For a full list of individual contributors, please see the commit history.

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

http://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

View Source
const (
	REGEX   = "" /* 212-byte string literal not displayed */
	TIMEOUT = 15 * time.Second
)

REGEX for matching /testrun/tercc-id/suite/main-suite-id/subsuite/subsuite-id/suite.

Variables

This section is empty.

Functions

func New

New returns a new LogAreaApplication object/struct.

Types

type Auth

type Auth struct {
	Username string  `json:"username"`
	Password Decrypt `json:"password"`
	AuthType string  `json:"type"`
}

func (Auth) DecryptPassword

func (a Auth) DecryptPassword(logger *logrus.Entry) string

DecryptPassword decrypts the password in the suite definition using a decryption key that has been provided as an environment variable.

type Decrypt

type Decrypt struct {
	Decrypt struct {
		Value string `json:"value"`
	} `json:"$decrypt"`
}

type Directory

type Directory struct {
	Logs      []Downloadable `json:"logs"`
	Artifacts []Downloadable `json:"artifacts"`
}

type Download

type Download struct {
	Request Request `json:"request"`
	Filters Filters `json:"filters"`
}

type Downloadable

type Downloadable struct {
	URL  string       `json:"url"`
	Name []FilterType `json:"name"`
}

type Filter

type Filter struct {
	URLs     []FilterType `json:"urls"`
	Filename []FilterType `json:"filename"`
}

func (Filter) Run

func (f Filter) Run(jsondata []byte, headers interface{}, suite []byte, baseURL string) ([]Downloadable, error)

Run the filters stored in the sub suite definition to get URLs from a json blob, headers or the suite definition (as json).

type FilterType

type FilterType struct {
	Source   string `json:"source"`
	JMESPath string `json:"jmespath"`
}

type Filters

type Filters struct {
	BaseURL   string `json:"base_url"`
	Logs      Filter `json:"logs"`
	Artifacts Filter `json:"artifacts"`
}

type LogArea

type LogArea struct {
	Download []Download `json:"download"`
}

type LogAreaApplication

type LogAreaApplication struct {
	// contains filtered or unexported fields
}

func (*LogAreaApplication) Close

func (a *LogAreaApplication) Close()

Close cancels the application context and closes the ETCD client.

func (LogAreaApplication) LoadRoutes

func (a LogAreaApplication) LoadRoutes(router *httprouter.Router)

LoadRoutes loads all the v1alpha routes.

type LogAreaHandler

type LogAreaHandler struct {
	// contains filtered or unexported fields
}

func (LogAreaHandler) GetFileURLs

func (h LogAreaHandler) GetFileURLs(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

GetFileURLs is an endpoint for getting file URLs from a log area.

func (LogAreaHandler) Selftest

Selftest is a handler to just return 204.

type Request

type Request struct {
	Auth    Auth                   `json:"auth,omitempty"`
	URL     string                 `json:"url"`
	Method  string                 `json:"method"`
	Headers map[string]string      `json:"headers,omitempty"`
	Params  map[string]interface{} `json:"params,omitempty"`
}

func (Request) Do

func (r Request) Do(ctx context.Context, logger *logrus.Entry) (*http.Response, error)

Do executes a request using the information in the Request part of the ETOS sub suite definition.

type Response

type Response map[string]Directory

type Suite

type Suite struct {
	Name    string  `json:"name"`
	LogArea LogArea `json:"log_area"`
}

Suite is the partial sub suite definition of ETOS.

Jump to

Keyboard shortcuts

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