lameduck

package
v0.0.0-...-b28dce8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package lameduck is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/targets/lameduck/config.proto

It has these top-level messages:

Options

Package lameduck implements a lameducks provider. Lameduck provider fetches lameducks from the RTC (Runtime Configurator) service. This functionality allows an operator to do hitless VM upgrades. If a target is set to be in lameduck by the operator, it is taken out of the targets list.

Index

Constants

View Source
const Default_Options_ExpirationSec int32 = 300
View Source
const Default_Options_ReEvalSec int32 = 10
View Source
const Default_Options_RuntimeconfigName string = "lame-duck-targets"

Variables

This section is empty.

Functions

func Init

func Init(optsProto *Options, l *logger.Logger) error

Init initialises the lameduck package. It has to be called before any other function of the package is called. TODO: Should instead return an interface, so that this behavior is clear.

func IsLameducking

func IsLameducking(name string) (bool, error)

IsLameducking checks if the target is in lameduck mode.

func Lameduck

func Lameduck(name string) error

Lameduck puts the target in lameduck mode.

func List

func List() ([]string, error)

List returns the targets that are in lameduck mode.

func UnLameduck

func UnLameduck(name string) error

UnLameduck removes the target from lameduck mode.

Types

type Options

type Options struct {
	// How often to check for lame-ducked targets
	ReEvalSec *int32 `protobuf:"varint,1,opt,name=re_eval_sec,json=reEvalSec,def=10" json:"re_eval_sec,omitempty"`
	// Runtime config project. If running on GCE, this defaults to the project
	// containing the VM.
	RuntimeconfigProject *string `protobuf:"bytes,2,opt,name=runtimeconfig_project,json=runtimeconfigProject" json:"runtimeconfig_project,omitempty"`
	// Lame duck targets runtime config name. An operator will create a variable
	// here to mark a target as lame-ducked.
	// TODO: This name needs to be changed.
	RuntimeconfigName *string `` /* 127-byte string literal not displayed */
	// Lame duck expiration time. We ignore variables (targets) that have been
	// updated more than these many seconds ago. This is a safety mechanism for
	// failing to cleanup. Also, the idea is that if a target has actually
	// disappeared, automatic targets expansion will take care of that some time
	// during this expiration period.
	ExpirationSec    *int32 `protobuf:"varint,4,opt,name=expiration_sec,json=expirationSec,def=300" json:"expiration_sec,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Options) Descriptor

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

func (*Options) GetExpirationSec

func (m *Options) GetExpirationSec() int32

func (*Options) GetReEvalSec

func (m *Options) GetReEvalSec() int32

func (*Options) GetRuntimeconfigName

func (m *Options) GetRuntimeconfigName() string

func (*Options) GetRuntimeconfigProject

func (m *Options) GetRuntimeconfigProject() string

func (*Options) ProtoMessage

func (*Options) ProtoMessage()

func (*Options) Reset

func (m *Options) Reset()

func (*Options) String

func (m *Options) String() string

Jump to

Keyboard shortcuts

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