Back to godoc.org

Package server

v0.8.4
Latest Go to latest

The highest tagged major version is .

Published: Jan 18, 2018 | License: Apache-2.0 | Module: github.com/UKHomeOffice/drone

Index

Variables

var Config = struct {
	Services struct {
		Pubsub     pubsub.Publisher
		Queue      queue.Queue
		Logs       logging.Log
		Senders    model.SenderService
		Secrets    model.SecretService
		Registries model.RegistryService
		Environ    model.EnvironService
		Limiter    model.Limiter
	}
	Storage struct {
		// Users  model.UserStore
		// Repos  model.RepoStore
		// Builds model.BuildStore
		// Logs   model.LogStore
		Config model.ConfigStore
		Files  model.FileStore
		Procs  model.ProcStore
	}
	Server struct {
		Key            string
		Cert           string
		Host           string
		Port           string
		Pass           string
		RepoConfig     string
		SessionExpires time.Duration
	}
	Pipeline struct {
		Limits     model.ResourceLimit
		Volumes    []string
		Networks   []string
		Privileged []string
	}
}{}

Config is an evil global configuration that will be used as we transition / refactor the codebase to move away from storing these values in the Context.

func ChownRepo

func ChownRepo(c *gin.Context)

func DeleteBuild

func DeleteBuild(c *gin.Context)

func DeleteBuildLogs

func DeleteBuildLogs(c *gin.Context)

func DeleteRegistry

func DeleteRegistry(c *gin.Context)

DeleteRegistry deletes the named registry from the database.

func DeleteRepo

func DeleteRepo(c *gin.Context)

func DeleteSecret

func DeleteSecret(c *gin.Context)

DeleteSecret deletes the named secret from the database.

func DeleteToken

func DeleteToken(c *gin.Context)

func DeleteUser

func DeleteUser(c *gin.Context)

func EventStreamSSE

func EventStreamSSE(c *gin.Context)

func FileGet

func FileGet(c *gin.Context)

FileGet gets a file by process and name

func FileList

func FileList(c *gin.Context)

FileList gets a list file by build.

func GetBadge

func GetBadge(c *gin.Context)

func GetBuild

func GetBuild(c *gin.Context)

func GetBuildLast

func GetBuildLast(c *gin.Context)

func GetBuildLogs

func GetBuildLogs(c *gin.Context)

func GetBuildQueue

func GetBuildQueue(c *gin.Context)

func GetBuilds

func GetBuilds(c *gin.Context)

func GetCC

func GetCC(c *gin.Context)

func GetFeed

func GetFeed(c *gin.Context)

func GetLoginToken

func GetLoginToken(c *gin.Context)

func GetLogout

func GetLogout(c *gin.Context)

func GetProcLogs

func GetProcLogs(c *gin.Context)

func GetQueueInfo

func GetQueueInfo(c *gin.Context)

func GetRegistry

func GetRegistry(c *gin.Context)

GetRegistry gets the name registry from the database and writes to the response in json format.

func GetRegistryList

func GetRegistryList(c *gin.Context)

GetRegistryList gets the registry list from the database and writes to the response in json format.

func GetRepo

func GetRepo(c *gin.Context)

func GetRepos

func GetRepos(c *gin.Context)

func GetSecret

func GetSecret(c *gin.Context)

GetSecret gets the named secret from the database and writes to the response in json format.

func GetSecretList

func GetSecretList(c *gin.Context)

GetSecretList gets the secret list from the database and writes to the response in json format.

func GetSelf

func GetSelf(c *gin.Context)

func GetUser

func GetUser(c *gin.Context)

func GetUsers

func GetUsers(c *gin.Context)

func HandleAuth

func HandleAuth(c *gin.Context)

func HandleLogin

func HandleLogin(c *gin.Context)

func Health

func Health(c *gin.Context)

Health endpoint returns a 500 if the server state is unhealthy.

func LogStreamSSE

func LogStreamSSE(c *gin.Context)

func MoveRepo

func MoveRepo(c *gin.Context)

func PatchRegistry

func PatchRegistry(c *gin.Context)

PatchRegistry updates the registry in the database.

func PatchRepo

func PatchRepo(c *gin.Context)

func PatchSecret

func PatchSecret(c *gin.Context)

PatchSecret updates the secret in the database.

func PatchUser

func PatchUser(c *gin.Context)

func PostApproval

func PostApproval(c *gin.Context)

func PostBuild

func PostBuild(c *gin.Context)

func PostDecline

func PostDecline(c *gin.Context)

func PostHook

func PostHook(c *gin.Context)

func PostRegistry

func PostRegistry(c *gin.Context)

PostRegistry persists the registry to the database.

func PostRepo

func PostRepo(c *gin.Context)

func PostSecret

func PostSecret(c *gin.Context)

PostSecret persists the secret to the database.

func PostToken

func PostToken(c *gin.Context)

func PostUser

func PostUser(c *gin.Context)

func RepairRepo

func RepairRepo(c *gin.Context)

func ToConfig

func ToConfig(c *gin.Context) *model.Settings

ToConfig returns the config from the Context

func Version

func Version(c *gin.Context)

Version endpoint returns the server version and build information.

func ZombieKill

func ZombieKill(c *gin.Context)

ZombieKill kills zombie processes stuck in an infinite pending or running state. This can only be invoked by administrators and may have negative effects.

type DroneServer

type DroneServer struct {
	Remote remote.Remote
	Queue  queue.Queue
	Pubsub pubsub.Publisher
	Logger logging.Log
	Store  store.Store
	Host   string
}

DroneServer is a grpc server implementation.

func (*DroneServer) Done

func (s *DroneServer) Done(c oldcontext.Context, req *proto.DoneRequest) (*proto.Empty, error)

func (*DroneServer) Extend

func (s *DroneServer) Extend(c oldcontext.Context, req *proto.ExtendRequest) (*proto.Empty, error)

func (*DroneServer) Init

func (s *DroneServer) Init(c oldcontext.Context, req *proto.InitRequest) (*proto.Empty, error)

func (*DroneServer) Log

func (s *DroneServer) Log(c oldcontext.Context, req *proto.LogRequest) (*proto.Empty, error)

func (*DroneServer) Next

func (s *DroneServer) Next(c oldcontext.Context, req *proto.NextRequest) (*proto.NextReply, error)

func (*DroneServer) Update

func (s *DroneServer) Update(c oldcontext.Context, req *proto.UpdateRequest) (*proto.Empty, error)

func (*DroneServer) Upload

func (s *DroneServer) Upload(c oldcontext.Context, req *proto.UploadRequest) (*proto.Empty, error)

func (*DroneServer) Wait

func (s *DroneServer) Wait(c oldcontext.Context, req *proto.WaitRequest) (*proto.Empty, error)

type RPC

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

func (*RPC) Done

func (s *RPC) Done(c context.Context, id string, state rpc.State) error

Done implements the rpc.Done function

func (*RPC) Extend

func (s *RPC) Extend(c context.Context, id string) error

Extend implements the rpc.Extend function

func (*RPC) Init

func (s *RPC) Init(c context.Context, id string, state rpc.State) error

Init implements the rpc.Init function

func (*RPC) Log

func (s *RPC) Log(c context.Context, id string, line *rpc.Line) error

Log implements the rpc.Log function

func (*RPC) Next

func (s *RPC) Next(c context.Context, filter rpc.Filter) (*rpc.Pipeline, error)

Next implements the rpc.Next function

func (*RPC) Update

func (s *RPC) Update(c context.Context, id string, state rpc.State) error

Update implements the rpc.Update function

func (*RPC) Upload

func (s *RPC) Upload(c context.Context, id string, file *rpc.File) error

Upload implements the rpc.Upload function

func (*RPC) Wait

func (s *RPC) Wait(c context.Context, id string) error

Wait implements the rpc.Wait function

type Syncer

type Syncer interface {
	Sync(user *model.User) error
}

Syncer synces the user repository and permissions.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier