server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func About

func About(c *gin.Context)

func CreatePipelineReport

func CreatePipelineReport(c *gin.Context)

CreatePipelineReport insert a new report into the database

func DeletePipelineReport

func DeletePipelineReport(c *gin.Context)

DeletePipelineReport removes a pipeline report from the database

func FindAllPipelineReports

func FindAllPipelineReports(c *gin.Context)

FindAllPipelineReports returns all pipeline reports from the database

func FindPipelineReportByID

func FindPipelineReportByID(c *gin.Context)

FindPipelineReportByID returns the latest pipeline report for a specific ID

func Landing

func Landing(c *gin.Context)

func Ping

func Ping(c *gin.Context)

func UpdatePipelineReport

func UpdatePipelineReport(c *gin.Context)

Types

type AuthOptions

type AuthOptions struct {
	// The issuer of our token.
	Issuer string

	// The audience of our token.
	Audience []string

	// Mode enable auth0 authentication
	Mode string
}

func (*AuthOptions) Init

func (a *AuthOptions) Init()

type CustomClaims

type CustomClaims struct {
	Name         string `json:"name"`
	Username     string `json:"username"`
	ShouldReject bool   `json:"shouldReject,omitempty"`
}

CustomClaims contains custom data we want from the jwt token.

func (*CustomClaims) Validate

func (c *CustomClaims) Validate(ctx context.Context) error

Validate errors out if `ShouldReject` is true.

type Options

type Options struct {
	Auth AuthOptions
}

Options holds the server options

func (*Options) Init

func (o *Options) Init()

type PipelineReport

type PipelineReport struct {
	Name       string
	Err        string
	Result     string
	Sources    map[string]PipelineReportSource
	Conditions map[string]PipelineReportCondition
	Targets    map[string]PipelineReportTarget
}

type PipelineReportCondition

type PipelineReportCondition struct {
	//Name holds the condition name
	Name string
	/*
		Result holds the condition result, accepted values must be one:
			* "SUCCESS"
			* "FAILURE"
			* "ATTENTION"
			* "SKIPPED"
	*/
	Result string
	// Pass stores the information detected by the condition execution.
	Pass bool
	// Description stores the condition execution description.
	Description string
}

PipelineReportCondition holds condition execution result

type PipelineReportSource

type PipelineReportSource struct {
	// Name holds the source name
	Name string
	/*
		Result holds the source result, accepted values must be one:
			* "SUCCESS"
			* "FAILURE"
			* "ATTENTION"
			* "SKIPPED"
	*/
	Result string
	// Information stores the information detected by the source execution such as a version
	Information string
	// Description stores the source execution description
	Description string
}

type PipelineReportTarget

type PipelineReportTarget struct {
	// Name holds the target name
	Name string
	/*
		Result holds the target result, accepted values must be one:
			* "SUCCESS"
			* "FAILURE"
			* "ATTENTION"
			* "SKIPPED"
	*/
	Result string
	// OldInformation stores the old information detected by the target execution
	OldInformation string
	// NewInformation stores the new information updated by during the target execution
	NewInformation string
	// Description stores the target execution description
	Description string
	// Files holds the list of files modified by a target execution
	Files   []string
	Changed bool
}

PipelineReportTarget holds target execution result

type PipelineRow

type PipelineRow struct {
	ID         uuid.UUID
	Pipeline   PipelineReport
	Created_at time.Time
	Updated_at time.Time
}

type Server

type Server struct {
	Options Options
}

func (*Server) Run

func (s *Server) Run()

Jump to

Keyboard shortcuts

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