model

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const Progressing = "Progressing"
View Source
const ReconciliationFailed = "ReconciliationFailed"
View Source
const ReconciliationSucceeded = "ReconciliationSucceeded"
View Source
const ReposWithCleanupPolicy = "reposWithCleanupPolicy"

ReposWithCleanupPolicy an array of repo names that have a cleanup policy

View Source
const StatusError = "error"
View Source
const StatusNew = "new"
View Source
const StatusProcessed = "processed"
View Source
const TypeArtifact = "artifact"
View Source
const TypeBranchDeleted = "branchDeleted"
View Source
const TypeRelease = "release"
View Source
const TypeRollback = "rollback"
View Source
const ValidationFailed = "ValidationFailed"

Variables

This section is empty.

Functions

func ToArtifact

func ToArtifact(a *Event) (*dx.Artifact, error)

Types

type Event

type Event struct {
	ID           string   `json:"id,omitempty"  meddler:"id"`
	Created      int64    `json:"created,omitempty"  meddler:"created"`
	Type         string   `json:"type,omitempty"  meddler:"type"`
	Blob         string   `json:"blob,omitempty"  meddler:"blob"`
	Status       string   `json:"status"  meddler:"status"`
	StatusDesc   string   `json:"statusDesc"  meddler:"status_desc"`
	GitopsHashes []string `json:"gitopsHashes"  meddler:"gitops_hashes,json"`

	// denormalized artifact fields
	Repository   string      `json:"repository,omitempty"  meddler:"repository"`
	Branch       string      `json:"branch,omitempty"  meddler:"branch"`
	Event        dx.GitEvent `json:"event,omitempty"  meddler:"event"`
	SourceBranch string      `json:"sourceBranch,omitempty"  meddler:"source_branch"`
	TargetBranch string      `json:"targetBranch,omitempty"  meddler:"target_branch"`
	Tag          string      `json:"tag,omitempty"  meddler:"tag"`
	SHA          string      `json:"sha"  meddler:"sha"`
	ArtifactID   string      `json:"artifactID"  meddler:"artifact_id"`
}

func ToEvent

func ToEvent(artifact dx.Artifact) (*Event, error)

type GitopsCommit added in v0.4.0

type GitopsCommit struct {
	ID         int64  `json:"-"  meddler:"id,pk"`
	Sha        string `json:"sha,omitempty"  meddler:"sha"`
	Status     string `json:"status,omitempty"  meddler:"status"`
	StatusDesc string `json:"statusDesc,omitempty"  meddler:"status_desc"`
}

type KeyValue added in v0.5.0

type KeyValue struct {
	// ID for this repo
	// required: true
	ID int64 `json:"id" meddler:"id,pk"`

	// Key is the name of the setting
	// required: true
	Key string `json:"key"  meddler:"key"`

	// Value is the setting itself
	Value string `json:"value"  meddler:"value"`
}

KeyValue is a key-value pair for simple storage for things fit in the data model

type User

type User struct {
	// ID for this user
	// required: true
	ID int64 `json:"-"  meddler:"id,pk"`

	// Login is the username for this user
	// required: true
	Login string `json:"login"  meddler:"login"`

	// Token is the user's api JWT token - not persisted
	Token string `json:"token"  meddler:"-"'`

	// Secret is the key used to sign JWT and CSRF tokens
	Secret string `json:"-" meddler:"secret"`

	// If the user is admin
	Admin bool `json:"admin"  meddler:"admin"`
}

User is the user representation

Jump to

Keyboard shortcuts

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