migration

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package migration is a generated protocol buffer package.

It is generated from these files:

migration.proto

It has these top-level messages:

Empty
HealthCheckResponse
PauseRequest
PauseResponse
ResumeResponse
MigrateResponse
UnmigrateResponse

Index

Constants

This section is empty.

Variables

View Source
var HealthCheckResponse_Status_name = map[int32]string{
	0: "UNKNOWN",
	1: "HEALTHY",
	2: "UNHEALTHY",
}
View Source
var HealthCheckResponse_Status_value = map[string]int32{
	"UNKNOWN":   0,
	"HEALTHY":   1,
	"UNHEALTHY": 2,
}

Functions

func NewMigration

func NewMigration(cfg MigrationConfig) *migration

func NewServer

func NewServer(options ...func(*migrationServer)) *migrationServer

func RegisterMigrationServer

func RegisterMigrationServer(s *grpc.Server, srv MigrationServer)

func WithClock

func WithClock(c clock) func(*migrationServer)

func WithPGBouncer

func WithPGBouncer(bouncer pgBouncerPauser) func(*migrationServer)

func WithPacemaker

func WithPacemaker(c crm) func(*migrationServer)

func WithServerLogger

func WithServerLogger(logger *logrus.Logger) func(*migrationServer)

Types

type Empty

type Empty struct {
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type HealthCheckResponse

type HealthCheckResponse struct {
	Status HealthCheckResponse_Status `protobuf:"varint,1,opt,name=status,enum=migration.HealthCheckResponse_Status" json:"status,omitempty"`
}

func (*HealthCheckResponse) Descriptor

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

func (*HealthCheckResponse) GetStatus

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) Reset

func (m *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (m *HealthCheckResponse) String() string

type HealthCheckResponse_Status

type HealthCheckResponse_Status int32
const (
	HealthCheckResponse_UNKNOWN   HealthCheckResponse_Status = 0
	HealthCheckResponse_HEALTHY   HealthCheckResponse_Status = 1
	HealthCheckResponse_UNHEALTHY HealthCheckResponse_Status = 2
)

func (HealthCheckResponse_Status) EnumDescriptor

func (HealthCheckResponse_Status) EnumDescriptor() ([]byte, []int)

func (HealthCheckResponse_Status) String

type MigrateResponse

type MigrateResponse struct {
	MigratingTo string                     `protobuf:"bytes,1,opt,name=migrating_to,json=migratingTo" json:"migrating_to,omitempty"`
	Address     string                     `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"`
	CreatedAt   *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
}

func (*MigrateResponse) Descriptor

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

func (*MigrateResponse) GetAddress

func (m *MigrateResponse) GetAddress() string

func (*MigrateResponse) GetCreatedAt

func (m *MigrateResponse) GetCreatedAt() *google_protobuf.Timestamp

func (*MigrateResponse) GetMigratingTo

func (m *MigrateResponse) GetMigratingTo() string

func (*MigrateResponse) ProtoMessage

func (*MigrateResponse) ProtoMessage()

func (*MigrateResponse) Reset

func (m *MigrateResponse) Reset()

func (*MigrateResponse) String

func (m *MigrateResponse) String() string

type MigrationClient

type MigrationClient interface {
	HealthCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*HealthCheckResponse, error)
	Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*PauseResponse, error)
	Resume(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ResumeResponse, error)
	Migrate(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*MigrateResponse, error)
	Unmigrate(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*UnmigrateResponse, error)
}

func NewMigrationClient

func NewMigrationClient(cc *grpc.ClientConn) MigrationClient

type MigrationConfig

type MigrationConfig struct {
	*logrus.Logger
	Etcd               etcdClient
	EtcdMasterKey      string
	Clients            []MigrationClient
	Locker             locker
	HealthCheckTimeout time.Duration
	LockTimeout        time.Duration
	PauseTimeout       time.Duration
	PauseExpiry        time.Duration
	PacemakerTimeout   time.Duration
}

type PauseRequest

type PauseRequest struct {
	Timeout int32 `protobuf:"varint,1,opt,name=timeout" json:"timeout,omitempty"`
	Expiry  int32 `protobuf:"varint,2,opt,name=expiry" json:"expiry,omitempty"`
}

func (*PauseRequest) Descriptor

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

func (*PauseRequest) GetExpiry

func (m *PauseRequest) GetExpiry() int32

func (*PauseRequest) GetTimeout

func (m *PauseRequest) GetTimeout() int32

func (*PauseRequest) ProtoMessage

func (*PauseRequest) ProtoMessage()

func (*PauseRequest) Reset

func (m *PauseRequest) Reset()

func (*PauseRequest) String

func (m *PauseRequest) String() string

type PauseResponse

type PauseResponse struct {
	CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
	ExpiresAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt" json:"expires_at,omitempty"`
}

func (*PauseResponse) Descriptor

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

func (*PauseResponse) GetCreatedAt

func (m *PauseResponse) GetCreatedAt() *google_protobuf.Timestamp

func (*PauseResponse) GetExpiresAt

func (m *PauseResponse) GetExpiresAt() *google_protobuf.Timestamp

func (*PauseResponse) ProtoMessage

func (*PauseResponse) ProtoMessage()

func (*PauseResponse) Reset

func (m *PauseResponse) Reset()

func (*PauseResponse) String

func (m *PauseResponse) String() string

type ResumeResponse

type ResumeResponse struct {
	CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
}

func (*ResumeResponse) Descriptor

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

func (*ResumeResponse) GetCreatedAt

func (m *ResumeResponse) GetCreatedAt() *google_protobuf.Timestamp

func (*ResumeResponse) ProtoMessage

func (*ResumeResponse) ProtoMessage()

func (*ResumeResponse) Reset

func (m *ResumeResponse) Reset()

func (*ResumeResponse) String

func (m *ResumeResponse) String() string

type UnmigrateResponse

type UnmigrateResponse struct {
	CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt" json:"created_at,omitempty"`
}

func (*UnmigrateResponse) Descriptor

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

func (*UnmigrateResponse) GetCreatedAt

func (m *UnmigrateResponse) GetCreatedAt() *google_protobuf.Timestamp

func (*UnmigrateResponse) ProtoMessage

func (*UnmigrateResponse) ProtoMessage()

func (*UnmigrateResponse) Reset

func (m *UnmigrateResponse) Reset()

func (*UnmigrateResponse) String

func (m *UnmigrateResponse) String() string

Jump to

Keyboard shortcuts

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