codeflow

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2017 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

API

This is a Codeflow service plugin that start an http server and register multiple api listeners.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BookmarksUpdated

func BookmarksUpdated(u *User) error

func CheckWorkflows

func CheckWorkflows(r *Release) error

func CollectStats

func CollectStats(save bool, stats *Statistics) error

func CreateDeploy

func CreateDeploy(r *Release) error

func CurrentProject

func CurrentProject(r *rest.Request, project *Project) error

CurrentProject finds project by slug

func CurrentUser

func CurrentUser(r *rest.Request, user *User) error

CurrentUser returns current user identifed by JWT token

func DockerBuildRebuild

func DockerBuildRebuild(r *Release) error

func DockerBuildStatus

func DockerBuildStatus(br *plugins.DockerBuild) error

func DockerDeployStatus

func DockerDeployStatus(e *plugins.DockerDeploy) error

func ExtensionCreated

func ExtensionCreated(lb *LoadBalancer) error

func ExtensionDeleted

func ExtensionDeleted(lb *LoadBalancer) error

func ExtensionUpdated

func ExtensionUpdated(lb *LoadBalancer) error

func FeatureCreated

func FeatureCreated(f *Feature, e agent.Event) error

func FeatureUpdated

func FeatureUpdated(r *Release) error

func GetCurrentRelease

func GetCurrentRelease(projectId bson.ObjectId, release *Release) error

func GitSyncProjects

func GitSyncProjects(ids []bson.ObjectId) error

func LoadBalancerStatus

func LoadBalancerStatus(lb *plugins.LoadBalancer) error

func NewRelease

func NewRelease(f Feature, u User, release *Release) error

func ProjectCreated

func ProjectCreated(p *Project) error

func ReleaseCreated

func ReleaseCreated(r *Release) error

func ReleasePromoted

func ReleasePromoted(r *Release) error

func ReleaseUpdated

func ReleaseUpdated(r *Release) error

func ServiceCreated

func ServiceCreated(s *Service) error

func ServiceDeleted

func ServiceDeleted(s *Service) error

func ServiceUpdated

func ServiceUpdated(s *Service) error

func StringToLoadBalancerType

func StringToLoadBalancerType(s string) plugins.Type

func StringToState

func StringToState(s string) plugins.State

func UpdateInProgessReleases

func UpdateInProgessReleases(f *Feature) error

Types

type Auth

type Auth struct {
	Path          string
	JWTMiddleware *jwt_m.JWTMiddleware
}

func (*Auth) Register

func (a *Auth) Register(api *rest.Api) []*rest.Route

type Bookmark

type Bookmark struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	UserId             bson.ObjectId `bson:"userId" json:"-"`
	Name               string        `bson:"-" json:"name"`
	Slug               string        `bson:"-" json:"slug"`
}

func (*Bookmark) AfterFind

func (b *Bookmark) AfterFind(collection *bongo.Collection) error

type Bookmarks

type Bookmarks struct {
	Path string
}

func (*Bookmarks) Register

func (x *Bookmarks) Register(api *rest.Api) []*rest.Route

type Build

type Build struct {
	bongo.DocumentBase `bson:",inline"`
	FeatureHash        string        `bson:"featureHash" json:"featureHash"`
	Type               string        `bson:"type" json:"type"`
	State              plugins.State `bson:"state" json:"state"`
	Image              string        `bson:"image" json:"image"`
	BuildLog           string        `bson:"buildLog" json:"buildLog"`
	BuildError         string        `bson:"buildError" json:"buildError"`
}

type Codeflow

type Codeflow struct {
	ServiceAddress string `mapstructure:"service_address"`
	Events         chan agent.Event

	Projects   *Projects
	Auth       *Auth
	Users      *Users
	Bookmarks  *Bookmarks
	Stats      *Stats
	MockEvents *MockEvents
}

func NewCodeflow

func NewCodeflow() *Codeflow

func (*Codeflow) AvailableCodeflowHandlers

func (x *Codeflow) AvailableCodeflowHandlers() []CodeflowHandler

Looks for fields which implement CodeflowHandler interface

func (*Codeflow) Description

func (x *Codeflow) Description() string

func (*Codeflow) Listen

func (x *Codeflow) Listen()

func (*Codeflow) Process

func (x *Codeflow) Process(e agent.Event) error

func (*Codeflow) SampleConfig

func (x *Codeflow) SampleConfig() string

func (*Codeflow) Start

func (x *Codeflow) Start(events chan agent.Event) error

func (*Codeflow) Stop

func (x *Codeflow) Stop()

func (*Codeflow) Subscribe

func (x *Codeflow) Subscribe() []string

type CodeflowHandler

type CodeflowHandler interface {
	Register(api *rest.Api) []*rest.Route
}

type ExternalFlowStatus

type ExternalFlowStatus struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	Hash               string        `bson:"hash" json:"hash"`
	Context            string        `bson:"context" json:"context"`
	Message            string        `bson:"message" json:"message"`
	State              plugins.State `bson:"state" json:"state"`
	OriginalState      string        `bson:"originalState" json:"originalState"`
}

type Feature

type Feature struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	Message            string        `bson:"message" json:"message"`
	User               string        `bson:"user" json:"user"`
	Hash               string        `bson:"hash" json:"hash"`
	ParentHash         string        `bson:"parentHash" json:"parentHash"`
	Ref                string        `bson:"ref" json:"ref"`
	ExternalLink       string        `bson:"externalLink" json:"externalLink"`
	Created            time.Time     `bson:"created" json:"created"`
}

func (*Feature) AfterFind

func (f *Feature) AfterFind(collection *bongo.Collection) error

type Flow

type Flow struct {
	bongo.DocumentBase `bson:",inline"`
	ReleaseId          bson.ObjectId `bson:"releaseId,omitempty" json:"releaseId"`
	Type               string        `bson:"type" json:"type"`
	Name               string        `bson:"name" json:"name"`
	Message            string        `bson:"message" json:"message"`
	State              plugins.State `bson:"state" json:"state"`
}

type Listener

type Listener struct {
	Port     int    `bson:"port" json:"port"`
	Protocol string `bson:"protocol" json:"protocol"`
}

type ListenerPair

type ListenerPair struct {
	Source      Listener `bson:"source" json:"source"`
	Destination Listener `bson:"destination" json:"destination"`
}

type LoadBalancer

type LoadBalancer struct {
	bongo.DocumentBase `bson:",inline"`
	Name               string         `bson:"name" json:"name"`
	ProjectId          bson.ObjectId  `bson:"projectId" json:"projectId"`
	ServiceId          bson.ObjectId  `bson:"serviceId" json:"serviceId"`
	Extension          string         `bson:"extension" json:"extension"`
	DNSName            string         `bson:"dnsName" json:"dnsName"`
	Type               string         `bson:"type" json:"type"`
	ListenerPairs      []ListenerPair `bson:"listenerPairs" json:"listenerPairs"`
	State              plugins.State  `bson:"state" json:"state"`
	StateMessage       string         `bson:"stateMessage" json:"stateMessage"`
}

type MockEvents

type MockEvents struct {
	Path string
}

func (*MockEvents) Register

func (x *MockEvents) Register(api *rest.Api) []*rest.Route

type Okta

type Okta struct {
	JWTMiddleware *jwt_m.JWTMiddleware
}

type PageResults

type PageResults struct {
	Records    interface{}          `json:"records"`
	Pagination bongo.PaginationInfo `json:"pagination"`
}

type Project

type Project struct {
	bongo.DocumentBase    `bson:",inline"`
	Name                  string   `bson:"name" json:"name"`
	Slug                  string   `bson:"slug" json:"slug"`
	Repository            string   `bson:"repository" json:"repository"`
	Secret                string   `bson:"secret" json:"secret"`
	Pinged                bool     `bson:"pinged" json:"pinged"`
	GitUrl                string   `bson:"gitUrl" json:"gitUrl" validate:"required"`
	GitProtocol           string   `bson:"gitProtocol" json:"gitProtocol" validate:"required"`
	RsaPrivateKey         string   `bson:"rsaPrivateKey" json:"-"`
	RsaPublicKey          string   `bson:"rsaPublicKey" json:"rsaPublicKey"`
	Bokmarked             bool     `bson:"-" json:"bookmarked"`
	ContinuousIntegration bool     `bson:"continuousIntegration" json:"continuousIntegration"`
	ContinuousDelivery    bool     `bson:"continuousDelivery" json:"continuousDelivery"`
	Workflows             []string `bson:"workflows" json:"workflows"`
	LogsUrl               string   `bson:"-" json:"logsUrl"`
	NotifyChannels        string   `bson:"notifyChannels" json:"notifyChannels"`
}

func (*Project) AfterFind

func (p *Project) AfterFind(*bongo.Collection) error

func (*Project) BeforeSave

func (p *Project) BeforeSave(collection *bongo.Collection) error

func (*Project) Validate

func (p *Project) Validate(collection *bongo.Collection) []error

type ProjectChange

type ProjectChange struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	ReleaseId          bson.ObjectId `bson:"releaseId,omitempty" json:"releaseId"`
	Name               string        `bson:"name" json:"name"`
	Message            string        `bson:"message" json:"message"`
}

type ProjectSettings

type ProjectSettings struct {
	ProjectId             bson.ObjectId `json:"projectId"`
	GitUrl                string        `json:"gitUrl"`
	GitProtocol           string        `json:"gitProtocol"`
	Secrets               []Secret      `json:"secrets"`
	DeletedSecrets        []Secret      `json:"deletedSecrets"`
	NotifyChannels        string        `json:"notifyChannels"`
	ContinuousIntegration bool          `json:"continuousIntegration"`
	ContinuousDelivery    bool          `json:"continuousDelivery"`
}

type Projects

type Projects struct {
	Path string
}

func (*Projects) Register

func (x *Projects) Register(api *rest.Api) []*rest.Route

type Release

type Release struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	HeadFeatureId      bson.ObjectId `bson:"headFeatureId" json:"-"`
	HeadFeature        Feature       `bson:"-" json:"headFeature"`
	TailFeatureId      bson.ObjectId `bson:"tailFeatureId" json:"-"`
	TailFeature        Feature       `bson:"-" json:"tailFeature"`
	UserId             bson.ObjectId `bson:"userId" json:"-"`
	User               User          `bson:"-" json:"user"`
	State              plugins.State `bson:"state" json:"state"`
	StateMessage       string        `bson:"stateMessage" json:"stateMessage"`
	Secrets            []Secret      `bson:"secrets" json:"-"`
	Services           []Service     `bson:"services" json:"-"`
	Workflow           []Flow        `bson:"-" json:"workflow"`
}

func (*Release) AfterFind

func (r *Release) AfterFind(collection *bongo.Collection) error

type Secret

type Secret struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"-"`
	Key                string        `bson:"key" json:"key"`
	Value              string        `bson:"value" json:"value"`
	Type               plugins.Type  `bson:"type" json:"type"`
	Deleted            bool          `bson:"deleted" json:"deleted"`
}

type Service

type Service struct {
	bongo.DocumentBase `bson:",inline"`
	ProjectId          bson.ObjectId `bson:"projectId" json:"projectId"`
	SpecId             bson.ObjectId `bson:"specId" json:"specId"`
	State              plugins.State `bson:"state" json:"state"`
	StateMessage       string        `bson:"stateMessage" json:"stateMessage"`
	Name               string        `bson:"name" json:"name"`
	Count              int           `bson:"count" json:"count"`
	Command            string        `bson:"command" json:"command"`
	Listeners          []Listener    `bson:"listeners" json:"listeners"`
}

func (*Service) AfterFind

func (s *Service) AfterFind(collection *bongo.Collection) error

func (*Service) BeforeSave

func (s *Service) BeforeSave(collection *bongo.Collection) error

type ServiceSpec

type ServiceSpec struct {
	bongo.DocumentBase            `bson:",inline"`
	Name                          string `bson:"name" json:"name"`
	CpuRequest                    string `bson:"cpuRequest" json:"cpuRequest"`
	CpuLimit                      string `bson:"cpuLimit" json:"cpuLimit"`
	MemoryRequest                 string `bson:"memoryRequest" json:"memoryRequest"`
	MemoryLimit                   string `bson:"memoryLimit" json:"memoryLimit"`
	TerminationGracePeriodSeconds int64  `bson:"terminationGracePeriodSeconds" json:"terminationGracePeriodSeconds"`
	Default                       bool   `bson:"default" json:"default"`
}

type Statistics

type Statistics struct {
	Projects int `bson:"projects" json:"projects"`
	Releases int `bson:"deploys" json:"releases"`
	Features int `bson:"features" json:"features"`
	Users    int `bson:"users" json:"users"`
}

type Stats

type Stats struct {
	Path string
}

func (*Stats) Register

func (x *Stats) Register(api *rest.Api) []*rest.Route

type User

type User struct {
	bongo.DocumentBase `bson:",inline"`
	Name               string `bson:"name" json:"name"`
	Username           string `bson:"username" json:"username"`
	Email              string `bson:"email" json:"email"`
}

type Users

type Users struct {
	Path string
}

func (*Users) Register

func (x *Users) Register(api *rest.Api) []*rest.Route

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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