Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRangeServer

func RegisterRangeServer(s *grpc.Server, srv RangeServer)

func ToEntry

func ToEntry(e *Entry) (irange.Entry, error)

    ToEntry converts the given *Entry to an irange.Entry.

    func ToID

    func ToID(id *ID) (irange.ID, error)

      ToID converts the given *ID to an irange.ID.

      func ToInfo

      func ToInfo(ir *InfoResponse) (irange.Info, error)

        ToInfo converts the given *InfoResponse to an irange.Info.

        func ToName

        func ToName(nm *Name) (string, error)

          ToName converts the given *Name to a string.

          func ToNameAndEntry

          func ToNameAndEntry(ne *NameAndEntry) (name string, entry int64, err error)

            ToNameAndEntry converts the given *NameAndEntry to a string and an int64.

            func ToNames

            func ToNames(lr *ListResponse) ([]string, error)

              ToNames converts the given *ListResponse into a slice of strings.

              func ToRangeSpecification

              func ToRangeSpecification(rs *RangeSpecification) (name string, r irange.Range, lifetime time.Duration, maxRetries int, maxConcurrency int, err error)

                ToRangeSpecification converts the given *RangeSpecification to a name, range r, lifetime, maximum number of retries and maximum concurrency.

                func ToStatus

                func ToStatus(sr *StatusResponse) (irange.Status, error)

                  ToStatus converts the given *StatusResponse into an irange.Status.

                  Types

                  type Entry

                  type Entry struct {
                  	Id                   string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
                  	Value                int64                `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
                  	Deadline             *timestamp.Timestamp `protobuf:"bytes,3,opt,name=deadline,proto3" json:"deadline,omitempty"`
                  	Failures             int64                `protobuf:"varint,4,opt,name=failures,proto3" json:"failures,omitempty"`
                  	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
                  	XXX_unrecognized     []byte               `json:"-"`
                  	XXX_sizecache        int32                `json:"-"`
                  }

                    Entry describes an active entry in a range.

                    func FromEntry

                    func FromEntry(e irange.Entry) (*Entry, error)

                      FromEntry converts the given irange.Entry to a *Entry.

                      func (*Entry) Descriptor

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

                      func (*Entry) GetDeadline

                      func (m *Entry) GetDeadline() *timestamp.Timestamp

                      func (*Entry) GetFailures

                      func (m *Entry) GetFailures() int64

                      func (*Entry) GetId

                      func (m *Entry) GetId() string

                      func (*Entry) GetValue

                      func (m *Entry) GetValue() int64

                      func (*Entry) ProtoMessage

                      func (*Entry) ProtoMessage()

                      func (*Entry) Reset

                      func (m *Entry) Reset()

                      func (*Entry) String

                      func (m *Entry) String() string

                      func (*Entry) XXX_DiscardUnknown

                      func (m *Entry) XXX_DiscardUnknown()

                      func (*Entry) XXX_Marshal

                      func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                      func (*Entry) XXX_Merge

                      func (m *Entry) XXX_Merge(src proto.Message)

                      func (*Entry) XXX_Size

                      func (m *Entry) XXX_Size() int

                      func (*Entry) XXX_Unmarshal

                      func (m *Entry) XXX_Unmarshal(b []byte) error

                      type ID

                      type ID struct {
                      	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
                      	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                      	XXX_unrecognized     []byte   `json:"-"`
                      	XXX_sizecache        int32    `json:"-"`
                      }

                        ID is an ID

                        func FromID

                        func FromID(id irange.ID) *ID

                          FromID converts the given id to a *ID.

                          func (*ID) Descriptor

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

                          func (*ID) GetId

                          func (m *ID) GetId() string

                          func (*ID) ProtoMessage

                          func (*ID) ProtoMessage()

                          func (*ID) Reset

                          func (m *ID) Reset()

                          func (*ID) String

                          func (m *ID) String() string

                          func (*ID) XXX_DiscardUnknown

                          func (m *ID) XXX_DiscardUnknown()

                          func (*ID) XXX_Marshal

                          func (m *ID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                          func (*ID) XXX_Merge

                          func (m *ID) XXX_Merge(src proto.Message)

                          func (*ID) XXX_Size

                          func (m *ID) XXX_Size() int

                          func (*ID) XXX_Unmarshal

                          func (m *ID) XXX_Unmarshal(b []byte) error

                          type InfoResponse

                          type InfoResponse struct {
                          	Value                int64                `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
                          	State                uint32               `protobuf:"varint,2,opt,name=state,proto3" json:"state,omitempty"`
                          	Appname              string               `protobuf:"bytes,3,opt,name=appname,proto3" json:"appname,omitempty"`
                          	Hostname             string               `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"`
                          	Start                *timestamp.Timestamp `protobuf:"bytes,5,opt,name=start,proto3" json:"start,omitempty"`
                          	Deadline             *timestamp.Timestamp `protobuf:"bytes,6,opt,name=deadline,proto3" json:"deadline,omitempty"`
                          	Failures             int64                `protobuf:"varint,7,opt,name=failures,proto3" json:"failures,omitempty"`
                          	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
                          	XXX_unrecognized     []byte               `json:"-"`
                          	XXX_sizecache        int32                `json:"-"`
                          }

                            InfoResponse holds information about an entry in a range.

                            func FromInfo

                            func FromInfo(inf irange.Info) (*InfoResponse, error)

                              FromInfo converts the given irange.Info to a *InfoResponse.

                              func (*InfoResponse) Descriptor

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

                              func (*InfoResponse) GetAppname

                              func (m *InfoResponse) GetAppname() string

                              func (*InfoResponse) GetDeadline

                              func (m *InfoResponse) GetDeadline() *timestamp.Timestamp

                              func (*InfoResponse) GetFailures

                              func (m *InfoResponse) GetFailures() int64

                              func (*InfoResponse) GetHostname

                              func (m *InfoResponse) GetHostname() string

                              func (*InfoResponse) GetStart

                              func (m *InfoResponse) GetStart() *timestamp.Timestamp

                              func (*InfoResponse) GetState

                              func (m *InfoResponse) GetState() uint32

                              func (*InfoResponse) GetValue

                              func (m *InfoResponse) GetValue() int64

                              func (*InfoResponse) ProtoMessage

                              func (*InfoResponse) ProtoMessage()

                              func (*InfoResponse) Reset

                              func (m *InfoResponse) Reset()

                              func (*InfoResponse) String

                              func (m *InfoResponse) String() string

                              func (*InfoResponse) XXX_DiscardUnknown

                              func (m *InfoResponse) XXX_DiscardUnknown()

                              func (*InfoResponse) XXX_Marshal

                              func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                              func (*InfoResponse) XXX_Merge

                              func (m *InfoResponse) XXX_Merge(src proto.Message)

                              func (*InfoResponse) XXX_Size

                              func (m *InfoResponse) XXX_Size() int

                              func (*InfoResponse) XXX_Unmarshal

                              func (m *InfoResponse) XXX_Unmarshal(b []byte) error

                              type ListResponse

                              type ListResponse struct {
                              	Names                []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
                              	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                              	XXX_unrecognized     []byte   `json:"-"`
                              	XXX_sizecache        int32    `json:"-"`
                              }

                                ListResponse holds a sequence of names.

                                func FromNames

                                func FromNames(names []string) *ListResponse

                                  FromNames converts the given names into a *ListResponse.

                                  func (*ListResponse) Descriptor

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

                                  func (*ListResponse) GetNames

                                  func (m *ListResponse) GetNames() []string

                                  func (*ListResponse) ProtoMessage

                                  func (*ListResponse) ProtoMessage()

                                  func (*ListResponse) Reset

                                  func (m *ListResponse) Reset()

                                  func (*ListResponse) String

                                  func (m *ListResponse) String() string

                                  func (*ListResponse) XXX_DiscardUnknown

                                  func (m *ListResponse) XXX_DiscardUnknown()

                                  func (*ListResponse) XXX_Marshal

                                  func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                                  func (*ListResponse) XXX_Merge

                                  func (m *ListResponse) XXX_Merge(src proto.Message)

                                  func (*ListResponse) XXX_Size

                                  func (m *ListResponse) XXX_Size() int

                                  func (*ListResponse) XXX_Unmarshal

                                  func (m *ListResponse) XXX_Unmarshal(b []byte) error

                                  type Name

                                  type Name struct {
                                  	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
                                  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                                  	XXX_unrecognized     []byte   `json:"-"`
                                  	XXX_sizecache        int32    `json:"-"`
                                  }

                                    Name is the name of a range

                                    func FromName

                                    func FromName(s string) *Name

                                      FromName converts the string s to a *Name.

                                      func (*Name) Descriptor

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

                                      func (*Name) GetName

                                      func (m *Name) GetName() string

                                      func (*Name) ProtoMessage

                                      func (*Name) ProtoMessage()

                                      func (*Name) Reset

                                      func (m *Name) Reset()

                                      func (*Name) String

                                      func (m *Name) String() string

                                      func (*Name) XXX_DiscardUnknown

                                      func (m *Name) XXX_DiscardUnknown()

                                      func (*Name) XXX_Marshal

                                      func (m *Name) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                                      func (*Name) XXX_Merge

                                      func (m *Name) XXX_Merge(src proto.Message)

                                      func (*Name) XXX_Size

                                      func (m *Name) XXX_Size() int

                                      func (*Name) XXX_Unmarshal

                                      func (m *Name) XXX_Unmarshal(b []byte) error

                                      type NameAndEntry

                                      type NameAndEntry struct {
                                      	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
                                      	Entry                int64    `protobuf:"varint,2,opt,name=entry,proto3" json:"entry,omitempty"`
                                      	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                                      	XXX_unrecognized     []byte   `json:"-"`
                                      	XXX_sizecache        int32    `json:"-"`
                                      }

                                        NameAndEntry is the name of a range and an entry in that range.

                                        func FromNameAndEntry

                                        func FromNameAndEntry(name string, entry int64) *NameAndEntry

                                          FromNameAndEntry converts the given name and entry to a *NameAndEntry

                                          func (*NameAndEntry) Descriptor

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

                                          func (*NameAndEntry) GetEntry

                                          func (m *NameAndEntry) GetEntry() int64

                                          func (*NameAndEntry) GetName

                                          func (m *NameAndEntry) GetName() string

                                          func (*NameAndEntry) ProtoMessage

                                          func (*NameAndEntry) ProtoMessage()

                                          func (*NameAndEntry) Reset

                                          func (m *NameAndEntry) Reset()

                                          func (*NameAndEntry) String

                                          func (m *NameAndEntry) String() string

                                          func (*NameAndEntry) XXX_DiscardUnknown

                                          func (m *NameAndEntry) XXX_DiscardUnknown()

                                          func (*NameAndEntry) XXX_Marshal

                                          func (m *NameAndEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                                          func (*NameAndEntry) XXX_Merge

                                          func (m *NameAndEntry) XXX_Merge(src proto.Message)

                                          func (*NameAndEntry) XXX_Size

                                          func (m *NameAndEntry) XXX_Size() int

                                          func (*NameAndEntry) XXX_Unmarshal

                                          func (m *NameAndEntry) XXX_Unmarshal(b []byte) error

                                          type RangeClient

                                          type RangeClient interface {
                                          	// Create creates a range.
                                          	Create(ctx context.Context, in *RangeSpecification, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// Delete deletes a range.
                                          	Delete(ctx context.Context, in *Name, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// Next returns the next entry in a range.
                                          	Next(ctx context.Context, in *Name, opts ...grpc.CallOption) (*Entry, error)
                                          	// Success indicates that a given entry has succeeded.
                                          	Success(ctx context.Context, in *ID, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// Error indicates that a given entry has failed and should be retried.
                                          	Error(ctx context.Context, in *ID, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// Requeue indicates that a given entry should be retried, without incrementing the number of failures.
                                          	Requeue(ctx context.Context, in *ID, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// Fatal indicates that a given entry has failed and should not be retried.
                                          	Fatal(ctx context.Context, in *ID, opts ...grpc.CallOption) (*empty.Empty, error)
                                          	// List returns the names of all known ranges.
                                          	List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListResponse, error)
                                          	// Status returns the remaining, active, succeeded, and failed entries in a range.
                                          	Status(ctx context.Context, in *Name, opts ...grpc.CallOption) (*StatusResponse, error)
                                          	// Info returns information about an entry in a range.
                                          	Info(ctx context.Context, in *NameAndEntry, opts ...grpc.CallOption) (*InfoResponse, error)
                                          }

                                            RangeClient is the client API for Range service.

                                            For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

                                            func NewRangeClient

                                            func NewRangeClient(cc *grpc.ClientConn) RangeClient

                                            type RangeServer

                                            type RangeServer interface {
                                            	// Create creates a range.
                                            	Create(context.Context, *RangeSpecification) (*empty.Empty, error)
                                            	// Delete deletes a range.
                                            	Delete(context.Context, *Name) (*empty.Empty, error)
                                            	// Next returns the next entry in a range.
                                            	Next(context.Context, *Name) (*Entry, error)
                                            	// Success indicates that a given entry has succeeded.
                                            	Success(context.Context, *ID) (*empty.Empty, error)
                                            	// Error indicates that a given entry has failed and should be retried.
                                            	Error(context.Context, *ID) (*empty.Empty, error)
                                            	// Requeue indicates that a given entry should be retried, without incrementing the number of failures.
                                            	Requeue(context.Context, *ID) (*empty.Empty, error)
                                            	// Fatal indicates that a given entry has failed and should not be retried.
                                            	Fatal(context.Context, *ID) (*empty.Empty, error)
                                            	// List returns the names of all known ranges.
                                            	List(context.Context, *empty.Empty) (*ListResponse, error)
                                            	// Status returns the remaining, active, succeeded, and failed entries in a range.
                                            	Status(context.Context, *Name) (*StatusResponse, error)
                                            	// Info returns information about an entry in a range.
                                            	Info(context.Context, *NameAndEntry) (*InfoResponse, error)
                                            }

                                              RangeServer is the server API for Range service.

                                              type RangeSpecification

                                              type RangeSpecification struct {
                                              	Name                 string             `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
                                              	Range                string             `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"`
                                              	Lifetime             *duration.Duration `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
                                              	MaxRetries           int64              `protobuf:"varint,4,opt,name=maxRetries,proto3" json:"maxRetries,omitempty"`
                                              	MaxConcurrency       int64              `protobuf:"varint,5,opt,name=maxConcurrency,proto3" json:"maxConcurrency,omitempty"`
                                              	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
                                              	XXX_unrecognized     []byte             `json:"-"`
                                              	XXX_sizecache        int32              `json:"-"`
                                              }

                                                RangeSpecification describes a range to be stored.

                                                func FromRangeSpecification

                                                func FromRangeSpecification(name string, r irange.Range, lifetime time.Duration, maxRetries int, maxConcurrency int) *RangeSpecification

                                                  FromRangeSpecification converts the the given name, range r, lifetime, maximum number of retries and maximum concurrency to a *RangeSpecification.

                                                  func (*RangeSpecification) Descriptor

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

                                                  func (*RangeSpecification) GetLifetime

                                                  func (m *RangeSpecification) GetLifetime() *duration.Duration

                                                  func (*RangeSpecification) GetMaxConcurrency

                                                  func (m *RangeSpecification) GetMaxConcurrency() int64

                                                  func (*RangeSpecification) GetMaxRetries

                                                  func (m *RangeSpecification) GetMaxRetries() int64

                                                  func (*RangeSpecification) GetName

                                                  func (m *RangeSpecification) GetName() string

                                                  func (*RangeSpecification) GetRange

                                                  func (m *RangeSpecification) GetRange() string

                                                  func (*RangeSpecification) ProtoMessage

                                                  func (*RangeSpecification) ProtoMessage()

                                                  func (*RangeSpecification) Reset

                                                  func (m *RangeSpecification) Reset()

                                                  func (*RangeSpecification) String

                                                  func (m *RangeSpecification) String() string

                                                  func (*RangeSpecification) XXX_DiscardUnknown

                                                  func (m *RangeSpecification) XXX_DiscardUnknown()

                                                  func (*RangeSpecification) XXX_Marshal

                                                  func (m *RangeSpecification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                                                  func (*RangeSpecification) XXX_Merge

                                                  func (m *RangeSpecification) XXX_Merge(src proto.Message)

                                                  func (*RangeSpecification) XXX_Size

                                                  func (m *RangeSpecification) XXX_Size() int

                                                  func (*RangeSpecification) XXX_Unmarshal

                                                  func (m *RangeSpecification) XXX_Unmarshal(b []byte) error

                                                  type StatusResponse

                                                  type StatusResponse struct {
                                                  	Pending              string   `protobuf:"bytes,1,opt,name=pending,proto3" json:"pending,omitempty"`
                                                  	Active               string   `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"`
                                                  	Succeeded            string   `protobuf:"bytes,3,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
                                                  	Failed               string   `protobuf:"bytes,4,opt,name=failed,proto3" json:"failed,omitempty"`
                                                  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                                                  	XXX_unrecognized     []byte   `json:"-"`
                                                  	XXX_sizecache        int32    `json:"-"`
                                                  }

                                                    StatusResponse holds four ranges

                                                    func FromStatus

                                                    func FromStatus(s irange.Status) (*StatusResponse, error)

                                                      FromStatus converts the given *irange.Status into a *StatusResponse.

                                                      func (*StatusResponse) Descriptor

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

                                                      func (*StatusResponse) GetActive

                                                      func (m *StatusResponse) GetActive() string

                                                      func (*StatusResponse) GetFailed

                                                      func (m *StatusResponse) GetFailed() string

                                                      func (*StatusResponse) GetPending

                                                      func (m *StatusResponse) GetPending() string

                                                      func (*StatusResponse) GetSucceeded

                                                      func (m *StatusResponse) GetSucceeded() string

                                                      func (*StatusResponse) ProtoMessage

                                                      func (*StatusResponse) ProtoMessage()

                                                      func (*StatusResponse) Reset

                                                      func (m *StatusResponse) Reset()

                                                      func (*StatusResponse) String

                                                      func (m *StatusResponse) String() string

                                                      func (*StatusResponse) XXX_DiscardUnknown

                                                      func (m *StatusResponse) XXX_DiscardUnknown()

                                                      func (*StatusResponse) XXX_Marshal

                                                      func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                                                      func (*StatusResponse) XXX_Merge

                                                      func (m *StatusResponse) XXX_Merge(src proto.Message)

                                                      func (*StatusResponse) XXX_Size

                                                      func (m *StatusResponse) XXX_Size() int

                                                      func (*StatusResponse) XXX_Unmarshal

                                                      func (m *StatusResponse) XXX_Unmarshal(b []byte) error

                                                      type UnimplementedRangeServer

                                                      type UnimplementedRangeServer struct {
                                                      }

                                                        UnimplementedRangeServer can be embedded to have forward compatible implementations.

                                                        func (*UnimplementedRangeServer) Create

                                                        func (*UnimplementedRangeServer) Delete

                                                        func (*UnimplementedRangeServer) Delete(ctx context.Context, req *Name) (*empty.Empty, error)

                                                        func (*UnimplementedRangeServer) Error

                                                        func (*UnimplementedRangeServer) Error(ctx context.Context, req *ID) (*empty.Empty, error)

                                                        func (*UnimplementedRangeServer) Fatal

                                                        func (*UnimplementedRangeServer) Fatal(ctx context.Context, req *ID) (*empty.Empty, error)

                                                        func (*UnimplementedRangeServer) Info

                                                        func (*UnimplementedRangeServer) List

                                                        func (*UnimplementedRangeServer) Next

                                                        func (*UnimplementedRangeServer) Next(ctx context.Context, req *Name) (*Entry, error)

                                                        func (*UnimplementedRangeServer) Requeue

                                                        func (*UnimplementedRangeServer) Requeue(ctx context.Context, req *ID) (*empty.Empty, error)

                                                        func (*UnimplementedRangeServer) Status

                                                        func (*UnimplementedRangeServer) Success

                                                        func (*UnimplementedRangeServer) Success(ctx context.Context, req *ID) (*empty.Empty, error)