types

package
v0.0.0-...-499a7fd Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoFromDeploymentMsg

func ProtoFromDeploymentMsg(d *DeploymentMessage) *commonTypes.Deployment

Types

type AccessTokenMessage

type AccessTokenMessage struct {
	Token string `json:"token"`
}

AccessTokenMessage is used for json binding

type ArtifactArrayMessage

type ArtifactArrayMessage struct {
	Total     int64              `json:total"`
	Artifacts []*ArtifactMessage `json:"artifacts"`
}

type ArtifactMessage

type ArtifactMessage struct {
	ID      int64  `json:"id"`
	BuildID int64  `json:"buildID"`
	Name    string `json:"name"`
}

func ArtifactMsgFromProto

func ArtifactMsgFromProto(a *commonTypes.BuildArtifact) *ArtifactMessage

type BranchConfig

type BranchConfig struct {
	ID           int64       `json:"-"`
	GithubRepoID int64       `json:"-" pg:",fk" sql:"on_delete:CASCADE"`
	GithubRepo   *GithubRepo `json:"-"`
	Branch       string      `json:"branch"`
	IsCiEnabled  bool        `json:"ciEnabled"`
}

BranchConfig sets CI configuration for specific branch of repo

type BranchMessage

type BranchMessage struct {
	BranchName string `json:"branch"`
}

BranchMessage is used for json binding

type BuildArrayMessage

type BuildArrayMessage struct {
	Total  int64           `json:"total"`
	Builds []*BuildMessage `json:"builds"`
}

func BuildArrayMsgFromProto

func BuildArrayMsgFromProto(b *commonTypes.BuildsArray) (*BuildArrayMessage, error)

type BuildMessage

type BuildMessage struct {
	ID            int64     `json:"id"`
	GithubRepoID  int64     `json:"repoID"`
	IsSuccessfull bool      `json:"isSuccessfull"`
	Date          time.Time `json:"date"`
	Branch        string    `json:"branch"`
	Stdout        string    `json:"stdout"`
}

func BuildMsgFromProto

func BuildMsgFromProto(b *commonTypes.Build) (*BuildMessage, error)

type BuildsQueryParams

type BuildsQueryParams struct {
	Branch string `form:"branch"`
	Page   int    `form:"page"`
	Limit  int    `form:"limit"`
}

type CommitMessage

type CommitMessage struct {
	SHA string `json:"id"`
}

type Config

type Config struct {
	// Port to listen for requests
	Port          int
	DBAddr        string
	DB            string
	DBUser        string
	DBPassword    string
	AdminLogin    string
	AdminPassword string
	JWTSecret     string
	RabbitAddress string
	CIAddress     string
	CDAddress     string
}

Config represents configuration for application

type CredentialsMessage

type CredentialsMessage struct {
	Login    string `json:"login"`
	Password string `json:"password"`
}

CredentialsMessage is used for json binding

type DeploymentArrayMessage

type DeploymentArrayMessage struct {
	Total       int64                `json:"total"`
	Deployments []*DeploymentMessage `json:"deployments"`
}

type DeploymentMessage

type DeploymentMessage struct {
	ID         int64  `json:"ID"`
	Branch     string `json:"branch"`
	RepoID     int64  `json:"repoID"`
	ArtifactID int64  `json:"artifactID"`
	K8SName    string `json:"k8sName"`
	Manifest   string `json:"manifest"`
	Replicas   int64  `json:"replicas"`
}

func DeploymentMsgFromProto

func DeploymentMsgFromProto(kd *commonTypes.Deployment) *DeploymentMessage

type GithubRepo

type GithubRepo struct {
	ID       int64  `json:"repoID"`
	FullName string `json:"fullName" sql:",unique"`
	UserID   int64  `json:"-" pg:",fk" sql:"on_delete:CASCADE"`
	User     *User  `json:"-"`
}

GithubRepo represents GitHub repository

type HeadMessage

type HeadMessage struct {
	Ref string `json:"ref"`
	SHA string `json:"sha"`
}

type ImageMessage

type ImageMessage struct {
	ImageID int64 `json:"imageID"`
}

type ManifestMessage

type ManifestMessage struct {
	Manifest string `json:"Manifest"`
}

type PGClientConfig

type PGClientConfig struct {
	DBAddr        string
	DB            string
	DBUser        string
	DBPassword    string
	AdminLogin    string
	AdminPassword string
}

type PaginationQueryParams

type PaginationQueryParams struct {
	Page  int `form:"page"`
	Limit int `form:"limit"`
}

type PullRequestMessage

type PullRequestMessage struct {
	Head HeadMessage `json:"head"`
}

type RepoArrayMessage

type RepoArrayMessage struct {
	Total int64        `json:"total"`
	Repos []GithubRepo `json:"repos"`
}

type RepoMessage

type RepoMessage struct {
	FullName string `json:"fullName"`
	ID       int64  `json:"repoID"`
}

RepoMessage is used for json binding

type RepositoryMessage

type RepositoryMessage struct {
	ID       int    `json:"id"`
	FullName string `json:"full_name"`
	GitURL   string `json:"clone_url"`
}

type RevisionArrayMessage

type RevisionArrayMessage struct {
	Total     int64              `json:"total"`
	Revisions []*RevisionMessage `json:"revisions"`
}

type RevisionMessage

type RevisionMessage struct {
	ID           int64     `json:"ID"`
	DeploymentID int64     `json:"deploymentID"`
	ArtifactID   int64     `json:"artifactID"`
	Date         time.Time `json:"date"`
	Stdout       string    `json:"stdout"`
	Replicas     int64     `json:"replicas"`
}

func RevisionMsgFromProto

func RevisionMsgFromProto(r *commonTypes.Revision) (*RevisionMessage, error)

type ScaleMessage

type ScaleMessage struct {
	Replicas int64 `json:"replicas"`
}

type User

type User struct {
	ID            int64  `json:"id"`
	Login         string `sql:",unique" json:"login"`
	Password      string `json:"-"`
	IsAdmin       bool   `json:"admin" sql:"default:false"`
	WebhookSecret string `json:"-" sql:"default:''"`
	AccessToken   string `json:"-" sql:"default:''"`
}

User represents system's user

func (User) Authenticate

func (u User) Authenticate(password string) bool

Authenticate checks if provided password matches for this user

type UserAdminMessage

type UserAdminMessage struct {
	IsAdmin bool `json:"admin"`
}

type UsersArrayMessage

type UsersArrayMessage struct {
	Total int64  `json:"total"`
	Users []User `json:"users"`
}

type WebhookMessage

type WebhookMessage struct {
	Action      string             `json:"action"`
	Repository  RepositoryMessage  `json:"repository"`
	Ref         string             `json:"ref"`
	PullRequest PullRequestMessage `json:"pull_request"`
	HeadCommit  CommitMessage      `json:"head_commit"`
}

WebhookMessage is used for json binding of webhook payload

type WebhookSecretMessage

type WebhookSecretMessage struct {
	Secret string `json:"secret"`
}

WebhookSecretMessage is used for json binding

Jump to

Keyboard shortcuts

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