server

package
v0.0.0-...-a6c55ee Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

* Copyright 2016 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	WebSocketPath    = "/agent-websocket"
	RegistrationPath = "/agent-register"
	StatusPath       = "/status"

	ConsoleLogPath = "/console"
	ArtifactsPath  = "/artifacts"
	PropertiesPath = "/properties"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentMessage

type AgentMessage struct {
	Msg *protocol.Message
	// contains filtered or unexported fields
}

type Cert

type Cert struct {
	Host         string
	ValidFrom    time.Time
	ValidFor     time.Duration
	IsCA         bool
	RsaBits      int
	Organization string
}

func NewCert

func NewCert(host string) *Cert

func (*Cert) Generate

func (c *Cert) Generate(certFile, keyFile string) error

type RemoteAgent

type RemoteAgent struct {
	// contains filtered or unexported fields
}

func (*RemoteAgent) Ack

func (agent *RemoteAgent) Ack(msg *protocol.Message) error

func (*RemoteAgent) Close

func (agent *RemoteAgent) Close() error

func (*RemoteAgent) Listen

func (agent *RemoteAgent) Listen(server *Server) error

func (*RemoteAgent) Send

func (agent *RemoteAgent) Send(msg *protocol.Message) error

func (*RemoteAgent) SetCookie

func (agent *RemoteAgent) SetCookie() error

func (*RemoteAgent) String

func (agent *RemoteAgent) String() string

type Server

type Server struct {
	Address        string
	CertPemFile    string
	KeyPemFile     string
	WorkingDir     string
	Logger         *log.Logger
	StateListeners []StateListener
	// contains filtered or unexported fields
}

func New

func New(address, certFile, keyFile, workingDir string, logger *log.Logger) *Server

func (*Server) ArtifactFile

func (s *Server) ArtifactFile(buildId, file string) string

func (*Server) ArtifactUrl

func (s *Server) ArtifactUrl(buildId, file string) string

func (*Server) Checksum

func (s *Server) Checksum(buildId string) (string, error)

func (*Server) ChecksumFile

func (s *Server) ChecksumFile(buildId string) string

func (*Server) ChecksumUrl

func (s *Server) ChecksumUrl(buildId string) string

func (*Server) ConsoleLog

func (s *Server) ConsoleLog(buildId string) (string, error)

func (*Server) ConsoleLogFile

func (s *Server) ConsoleLogFile(buildId string) string

func (*Server) HandleFunc

func (s *Server) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request))

func (*Server) LimittedRequestEntitySize

func (s *Server) LimittedRequestEntitySize(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func (*Server) MaxRequestEntitySize

func (s *Server) MaxRequestEntitySize() int64

func (*Server) Send

func (s *Server) Send(agentId string, msg *protocol.Message)

func (*Server) SendBuild

func (s *Server) SendBuild(agentId, buildId string, commands ...*protocol.BuildCommand)

func (*Server) SetMaxRequestEntitySize

func (s *Server) SetMaxRequestEntitySize(size int64)

func (*Server) Start

func (s *Server) Start() error

type StateListener

type StateListener interface {
	Notify(class, id, state string)
}

Jump to

Keyboard shortcuts

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