application

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is a application name.
	Name = "duci"
	// DefaultConfigurationPath is a path to configuration file
	DefaultConfigurationPath = "./config.yml"
)

Variables

This section is empty.

Functions

func ContextWithJob added in v0.8.0

func ContextWithJob(parent context.Context, job *BuildJob) context.Context

ContextWithJob set parent context BuildJob and returns it.

func CurrentVersion added in v0.7.0

func CurrentVersion() string

CurrentVersion returns current version string

func Initialize added in v0.8.0

func Initialize() error

Initialize singleton instances that are needed by application

func IsLatestVersion added in v0.7.0

func IsLatestVersion() bool

IsLatestVersion return witch latest stable version or not

func VersionString added in v0.7.0

func VersionString() string

VersionString returns application version

Types

type BuildJob added in v0.8.0

type BuildJob struct {
	ID           job.ID
	TargetSource *github.TargetSource
	TaskName     string
	TargetURL    *url.URL
	// contains filtered or unexported fields
}

BuildJob represents once of job

func BuildJobFromContext added in v0.8.0

func BuildJobFromContext(ctx context.Context) (*BuildJob, error)

BuildJobFromContext extract BuildJob from context

func (*BuildJob) BeginAt added in v0.8.12

func (j *BuildJob) BeginAt(time time.Time)

BeginAt set a time that begin job

func (*BuildJob) Duration added in v0.8.12

func (j *BuildJob) Duration() string

Duration returns job duration

func (*BuildJob) EndAt added in v0.8.12

func (j *BuildJob) EndAt(time time.Time)

EndAt set a time that end job

type Configuration

type Configuration struct {
	Server *Server `yaml:"server" json:"server"`
	GitHub *GitHub `yaml:"github" json:"github"`
	Job    *Job    `yaml:"job" json:"job"`
}

Configuration of application.

var (
	// Config is a application configuration.
	Config *Configuration
)

func (*Configuration) Addr

func (c *Configuration) Addr() string

Addr returns a string of server port

func (*Configuration) Set

func (c *Configuration) Set(path string) error

Set configuration with file path

func (*Configuration) String

func (c *Configuration) String() string

String returns default config path

func (*Configuration) Timeout added in v0.2.0

func (c *Configuration) Timeout() time.Duration

Timeout returns timeout duration.

func (*Configuration) Type added in v0.6.0

func (c *Configuration) Type() string

Type returns value type of itself

type GitHub added in v0.3.0

type GitHub struct {
	SSHKeyPath string     `yaml:"ssh_key_path" json:"sshKeyPath"`
	APIToken   maskString `yaml:"api_token" json:"apiToken"`
}

GitHub describes a configuration of github.

type Job added in v0.2.0

type Job struct {
	Timeout     int64 `yaml:"timeout" json:"timeout"`
	Concurrency int   `yaml:"concurrency" json:"concurrency"`
}

Job describes a configuration of each jobs.

type Server

type Server struct {
	WorkDir      string `yaml:"workdir" json:"workdir"`
	Port         int    `yaml:"port" json:"port"`
	DatabasePath string `yaml:"database_path" json:"databasePath"`
}

Server describes a configuration of server.

Directories

Path Synopsis
service
executor/mock_executor
Package mock_executor is a generated GoMock package.
Package mock_executor is a generated GoMock package.
job
job/mock_job
Package mock_job_service is a generated GoMock package.
Package mock_job_service is a generated GoMock package.

Jump to

Keyboard shortcuts

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