protoversion

package
v0.0.0-...-c5da4db Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MIT Imports: 15 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAPIHandler

func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAPIHandler registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAPIHandlerFromEndpoint

func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAPIHandlerFromEndpoint is same as RegisterAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAPIServer

func RegisterAPIServer(s *grpc.Server, srv APIServer)

Types

type APIClient

type APIClient interface {
	GetVersion(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*Version, error)
}

func NewAPIClient

func NewAPIClient(cc *grpc.ClientConn) APIClient

type APIServer

type APIServer interface {
	GetVersion(context.Context, *google_protobuf1.Empty) (*Version, error)
}

func NewAPIServer

func NewAPIServer(version *Version, options APIServerOptions) APIServer

NewAPIServer creates a new APIServer for the given Version.

type APIServerOptions

type APIServerOptions struct {
	DisableLogging bool
}

APIServerOptions are options when creating a new APIServer.

type Version

type Version struct {
	Major      uint32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
	Minor      uint32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"`
	Micro      uint32 `protobuf:"varint,3,opt,name=micro" json:"micro,omitempty"`
	Additional string `protobuf:"bytes,4,opt,name=additional" json:"additional,omitempty"`
}

func GetServerVersion

func GetServerVersion(clientConn *grpc.ClientConn) (*Version, error)

GetServerVersion gets the server *Version given the *grpc.ClientConn.

func (*Version) Descriptor

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

func (*Version) GetAdditional

func (m *Version) GetAdditional() string

func (*Version) GetMajor

func (m *Version) GetMajor() uint32

func (*Version) GetMicro

func (m *Version) GetMicro() uint32

func (*Version) GetMinor

func (m *Version) GetMinor() uint32

func (*Version) Println

func (v *Version) Println()

Println prints the VersionString() value with fmt.Println(...)

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) String

func (m *Version) String() string

func (*Version) VersionString

func (v *Version) VersionString() string

VersionString returns a string representation of the Version.

Jump to

Keyboard shortcuts

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