agent

package
v0.32.16 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.Build",
	HandlerType: (*BuildServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "BuildTag",
			Handler:    _Build_BuildTag_Handler,
		},
		{
			MethodName: "BuildCommit",
			Handler:    _Build_BuildCommit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/agent/agent.proto",
}

Build_ServiceDesc is the grpc.ServiceDesc for Build service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_internal_agent_agent_proto protoreflect.FileDescriptor
View Source
var JailHost_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.JailHost",
	HandlerType: (*JailHostServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _JailHost_List_Handler,
		},
		{
			MethodName: "Restart",
			Handler:    _JailHost_Restart_Handler,
		},
		{
			MethodName: "Start",
			Handler:    _JailHost_Start_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _JailHost_Stop_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/agent/agent.proto",
}

JailHost_ServiceDesc is the grpc.ServiceDesc for JailHost service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Node_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agent.Node",
	HandlerType: (*NodeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RunPuppetAgent",
			Handler:    _Node_RunPuppetAgent_Handler,
		},
		{
			MethodName: "PackageUpgrade",
			Handler:    _Node_PackageUpgrade_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/agent/agent.proto",
}

Node_ServiceDesc is the grpc.ServiceDesc for Node service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterBuildServer

func RegisterBuildServer(s grpc.ServiceRegistrar, srv BuildServer)

func RegisterJailHostServer

func RegisterJailHostServer(s grpc.ServiceRegistrar, srv JailHostServer)

func RegisterNodeServer

func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)

Types

type Agent

type Agent struct {
	NewRPCServer comms.RPCServerFunc
	// contains filtered or unexported fields
}

Agent is an RPC client worker bee.

func NewAgent

func NewAgent(cfg *config.Config, conn *grpc.ClientConn) (*Agent, error)

NewAgent returns a new *Agent from the given arguments.

func (*Agent) Start

func (a *Agent) Start() error

Start calls start on the agent gRPC server.

func (*Agent) Stop

func (a *Agent) Stop() error

Stop calls stop on the agent gRPC server.

type BuildClient

type BuildClient interface {
	BuildTag(ctx context.Context, in *BuildSpec, opts ...grpc.CallOption) (*CommandResult, error)
	BuildCommit(ctx context.Context, in *BuildSpec, opts ...grpc.CallOption) (*CommandResult, error)
}

BuildClient is the client API for Build service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewBuildClient

func NewBuildClient(cc grpc.ClientConnInterface) BuildClient

type BuildServer

type BuildServer interface {
	BuildTag(context.Context, *BuildSpec) (*CommandResult, error)
	BuildCommit(context.Context, *BuildSpec) (*CommandResult, error)
	// contains filtered or unexported methods
}

BuildServer is the server API for Build service. All implementations must embed UnimplementedBuildServer for forward compatibility

type BuildSpec

type BuildSpec struct {
	Project *ProjectSpec `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	Commit  string       `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"`
	Branch  string       `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"`
	Tag     string       `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

func (*BuildSpec) Descriptor deprecated

func (*BuildSpec) Descriptor() ([]byte, []int)

Deprecated: Use BuildSpec.ProtoReflect.Descriptor instead.

func (*BuildSpec) GetBranch

func (x *BuildSpec) GetBranch() string

func (*BuildSpec) GetCommit

func (x *BuildSpec) GetCommit() string

func (*BuildSpec) GetProject

func (x *BuildSpec) GetProject() *ProjectSpec

func (*BuildSpec) GetTag

func (x *BuildSpec) GetTag() string

func (*BuildSpec) ProtoMessage

func (*BuildSpec) ProtoMessage()

func (*BuildSpec) ProtoReflect

func (x *BuildSpec) ProtoReflect() protoreflect.Message

func (*BuildSpec) Reset

func (x *BuildSpec) Reset()

func (*BuildSpec) String

func (x *BuildSpec) String() string

type CommandResult

type CommandResult struct {
	Output   []byte `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
	Error    []byte `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	ExitCode int32  `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandResult) Descriptor deprecated

func (*CommandResult) Descriptor() ([]byte, []int)

Deprecated: Use CommandResult.ProtoReflect.Descriptor instead.

func (*CommandResult) GetError

func (x *CommandResult) GetError() []byte

func (*CommandResult) GetExitCode

func (x *CommandResult) GetExitCode() int32

func (*CommandResult) GetOutput

func (x *CommandResult) GetOutput() []byte

func (*CommandResult) ProtoMessage

func (*CommandResult) ProtoMessage()

func (*CommandResult) ProtoReflect

func (x *CommandResult) ProtoReflect() protoreflect.Message

func (*CommandResult) Reset

func (x *CommandResult) Reset()

func (*CommandResult) String

func (x *CommandResult) String() string

type Empty

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

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Jail

type Jail struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Path     string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*Jail) Descriptor deprecated

func (*Jail) Descriptor() ([]byte, []int)

Deprecated: Use Jail.ProtoReflect.Descriptor instead.

func (*Jail) GetHostname

func (x *Jail) GetHostname() string

func (*Jail) GetName

func (x *Jail) GetName() string

func (*Jail) GetPath

func (x *Jail) GetPath() string

func (*Jail) ProtoMessage

func (*Jail) ProtoMessage()

func (*Jail) ProtoReflect

func (x *Jail) ProtoReflect() protoreflect.Message

func (*Jail) Reset

func (x *Jail) Reset()

func (*Jail) String

func (x *Jail) String() string

type JailHostClient

type JailHostClient interface {
	List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Jails, error)
	Restart(ctx context.Context, in *Jail, opts ...grpc.CallOption) (*CommandResult, error)
	Start(ctx context.Context, in *Jail, opts ...grpc.CallOption) (*CommandResult, error)
	Stop(ctx context.Context, in *Jail, opts ...grpc.CallOption) (*CommandResult, error)
}

JailHostClient is the client API for JailHost service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewJailHostClient

func NewJailHostClient(cc grpc.ClientConnInterface) JailHostClient

type JailHostServer

type JailHostServer interface {
	List(context.Context, *Empty) (*Jails, error)
	Restart(context.Context, *Jail) (*CommandResult, error)
	Start(context.Context, *Jail) (*CommandResult, error)
	Stop(context.Context, *Jail) (*CommandResult, error)
	// contains filtered or unexported methods
}

JailHostServer is the server API for JailHost service. All implementations must embed UnimplementedJailHostServer for forward compatibility

type Jails

type Jails struct {
	Jails []*Jail `protobuf:"bytes,1,rep,name=jails,proto3" json:"jails,omitempty"`
	// contains filtered or unexported fields
}

func (*Jails) Descriptor deprecated

func (*Jails) Descriptor() ([]byte, []int)

Deprecated: Use Jails.ProtoReflect.Descriptor instead.

func (*Jails) GetJails

func (x *Jails) GetJails() []*Jail

func (*Jails) ProtoMessage

func (*Jails) ProtoMessage()

func (*Jails) ProtoReflect

func (x *Jails) ProtoReflect() protoreflect.Message

func (*Jails) Reset

func (x *Jails) Reset()

func (*Jails) String

func (x *Jails) String() string

type NodeClient

type NodeClient interface {
	RunPuppetAgent(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandResult, error)
	PackageUpgrade(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandResult, error)
}

NodeClient is the client API for Node service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewNodeClient

func NewNodeClient(cc grpc.ClientConnInterface) NodeClient

type NodeServer

type NodeServer interface {
	RunPuppetAgent(context.Context, *Empty) (*CommandResult, error)
	PackageUpgrade(context.Context, *Empty) (*CommandResult, error)
	// contains filtered or unexported methods
}

NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility

type ProjectSpec

type ProjectSpec struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Url  string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*ProjectSpec) Descriptor deprecated

func (*ProjectSpec) Descriptor() ([]byte, []int)

Deprecated: Use ProjectSpec.ProtoReflect.Descriptor instead.

func (*ProjectSpec) GetName

func (x *ProjectSpec) GetName() string

func (*ProjectSpec) GetUrl

func (x *ProjectSpec) GetUrl() string

func (*ProjectSpec) ProtoMessage

func (*ProjectSpec) ProtoMessage()

func (*ProjectSpec) ProtoReflect

func (x *ProjectSpec) ProtoReflect() protoreflect.Message

func (*ProjectSpec) Reset

func (x *ProjectSpec) Reset()

func (*ProjectSpec) String

func (x *ProjectSpec) String() string

type ProjectStatus

type ProjectStatus struct {
	HeadCommit string `protobuf:"bytes,1,opt,name=head_commit,json=headCommit,proto3" json:"head_commit,omitempty"`
	LatestTag  string `protobuf:"bytes,2,opt,name=latest_tag,json=latestTag,proto3" json:"latest_tag,omitempty"`
	// contains filtered or unexported fields
}

func (*ProjectStatus) Descriptor deprecated

func (*ProjectStatus) Descriptor() ([]byte, []int)

Deprecated: Use ProjectStatus.ProtoReflect.Descriptor instead.

func (*ProjectStatus) GetHeadCommit

func (x *ProjectStatus) GetHeadCommit() string

func (*ProjectStatus) GetLatestTag

func (x *ProjectStatus) GetLatestTag() string

func (*ProjectStatus) ProtoMessage

func (*ProjectStatus) ProtoMessage()

func (*ProjectStatus) ProtoReflect

func (x *ProjectStatus) ProtoReflect() protoreflect.Message

func (*ProjectStatus) Reset

func (x *ProjectStatus) Reset()

func (*ProjectStatus) String

func (x *ProjectStatus) String() string

type UnimplementedBuildServer

type UnimplementedBuildServer struct {
}

UnimplementedBuildServer must be embedded to have forward compatible implementations.

func (UnimplementedBuildServer) BuildCommit

func (UnimplementedBuildServer) BuildTag

type UnimplementedJailHostServer

type UnimplementedJailHostServer struct {
}

UnimplementedJailHostServer must be embedded to have forward compatible implementations.

func (UnimplementedJailHostServer) List

func (UnimplementedJailHostServer) Restart

func (UnimplementedJailHostServer) Start

func (UnimplementedJailHostServer) Stop

type UnimplementedNodeServer

type UnimplementedNodeServer struct {
}

UnimplementedNodeServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeServer) PackageUpgrade

func (UnimplementedNodeServer) RunPuppetAgent

type UnsafeBuildServer

type UnsafeBuildServer interface {
	// contains filtered or unexported methods
}

UnsafeBuildServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BuildServer will result in compilation errors.

type UnsafeJailHostServer

type UnsafeJailHostServer interface {
	// contains filtered or unexported methods
}

UnsafeJailHostServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JailHostServer will result in compilation errors.

type UnsafeNodeServer

type UnsafeNodeServer interface {
	// contains filtered or unexported methods
}

UnsafeNodeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeServer will result in compilation errors.

Jump to

Keyboard shortcuts

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