model

package
v0.3.2-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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"`

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