service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package service is a generated protocol buffer package.

It is generated from these files:

auth.proto
common.proto
service.proto

It has these top-level messages:

ConfigurationRequest
ConfigurationResponse
VerificationRequest
VerificationResponse
CommonRequest
CommonResponse
HelloRequest
HelloReply

Package service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthVerifierServer

func RegisterAuthVerifierServer(s *grpc.Server, srv AuthVerifierServer)

func RegisterGreeterHandler

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

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

func RegisterGreeterHandlerFromEndpoint

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

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

func RegisterGreeterServer

func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)

Types

type AuthVerifierClient

type AuthVerifierClient interface {
	// verify a token
	VerifyToken(ctx context.Context, in *VerificationRequest, opts ...grpc.CallOption) (*VerificationResponse, error)
	Configuration(ctx context.Context, in *ConfigurationRequest, opts ...grpc.CallOption) (*ConfigurationResponse, error)
}

func NewAuthVerifierClient

func NewAuthVerifierClient(cc *grpc.ClientConn) AuthVerifierClient

type AuthVerifierServer

type AuthVerifierServer interface {
	// verify a token
	VerifyToken(context.Context, *VerificationRequest) (*VerificationResponse, error)
	Configuration(context.Context, *ConfigurationRequest) (*ConfigurationResponse, error)
}

type CommonRequest

type CommonRequest struct {
	User          string `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"`
	CorrelationID string `protobuf:"bytes,2,opt,name=correlationID" json:"correlationID,omitempty"`
	SpanID        string `protobuf:"bytes,3,opt,name=spanID" json:"spanID,omitempty"`
}

The request message containing:

  • the authenticated user ID
  • the correlationID
  • the spanID

func (*CommonRequest) Descriptor

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

func (*CommonRequest) ProtoMessage

func (*CommonRequest) ProtoMessage()

func (*CommonRequest) Reset

func (m *CommonRequest) Reset()

func (*CommonRequest) String

func (m *CommonRequest) String() string

type CommonResponse

type CommonResponse struct {
	CorrelationID string `protobuf:"bytes,1,opt,name=correlationID" json:"correlationID,omitempty"`
}

The response message

func (*CommonResponse) Descriptor

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

func (*CommonResponse) ProtoMessage

func (*CommonResponse) ProtoMessage()

func (*CommonResponse) Reset

func (m *CommonResponse) Reset()

func (*CommonResponse) String

func (m *CommonResponse) String() string

type ConfigurationRequest

type ConfigurationRequest struct {
	Common *CommonRequest `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
}

func (*ConfigurationRequest) Descriptor

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

func (*ConfigurationRequest) GetCommon

func (m *ConfigurationRequest) GetCommon() *CommonRequest

func (*ConfigurationRequest) ProtoMessage

func (*ConfigurationRequest) ProtoMessage()

func (*ConfigurationRequest) Reset

func (m *ConfigurationRequest) Reset()

func (*ConfigurationRequest) String

func (m *ConfigurationRequest) String() string

type ConfigurationResponse

type ConfigurationResponse struct {
	Common    *CommonResponse `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
	LogonURL  string          `protobuf:"bytes,10,opt,name=logonURL" json:"logonURL,omitempty"`
	LogoutURL string          `protobuf:"bytes,11,opt,name=logoutURL" json:"logoutURL,omitempty"`
}

func (*ConfigurationResponse) Descriptor

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

func (*ConfigurationResponse) GetCommon

func (m *ConfigurationResponse) GetCommon() *CommonResponse

func (*ConfigurationResponse) ProtoMessage

func (*ConfigurationResponse) ProtoMessage()

func (*ConfigurationResponse) Reset

func (m *ConfigurationResponse) Reset()

func (*ConfigurationResponse) String

func (m *ConfigurationResponse) String() string

type GreeterClient

type GreeterClient interface {
	// Sends a greeting
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}

func NewGreeterClient

func NewGreeterClient(cc *grpc.ClientConn) GreeterClient

type GreeterServer

type GreeterServer interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
}

type HelloReply

type HelloReply struct {
	Common  *CommonResponse `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
	Message string          `protobuf:"bytes,10,opt,name=message" json:"message,omitempty"`
}

The response message containing the greetings

func (*HelloReply) Descriptor

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

func (*HelloReply) GetCommon

func (m *HelloReply) GetCommon() *CommonResponse

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) Reset

func (m *HelloReply) Reset()

func (*HelloReply) String

func (m *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Common *CommonRequest `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
	Name   string         `protobuf:"bytes,10,opt,name=name" json:"name,omitempty"`
}

The request message containing the user's name.

func (*HelloRequest) Descriptor

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

func (*HelloRequest) GetCommon

func (m *HelloRequest) GetCommon() *CommonRequest

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) String

func (m *HelloRequest) String() string

type VerificationRequest

type VerificationRequest struct {
	Common *CommonRequest `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
	Token  string         `protobuf:"bytes,10,opt,name=token" json:"token,omitempty"`
}

The request message containing the user's name.

func (*VerificationRequest) Descriptor

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

func (*VerificationRequest) GetCommon

func (m *VerificationRequest) GetCommon() *CommonRequest

func (*VerificationRequest) ProtoMessage

func (*VerificationRequest) ProtoMessage()

func (*VerificationRequest) Reset

func (m *VerificationRequest) Reset()

func (*VerificationRequest) String

func (m *VerificationRequest) String() string

type VerificationResponse

type VerificationResponse struct {
	Common          *CommonResponse `protobuf:"bytes,1,opt,name=common" json:"common,omitempty"`
	Valid           bool            `protobuf:"varint,10,opt,name=valid" json:"valid,omitempty"`
	UserID          string          `protobuf:"bytes,11,opt,name=userID" json:"userID,omitempty"`
	CacheExpiration int64           `protobuf:"varint,12,opt,name=cacheExpiration" json:"cacheExpiration,omitempty"`
}

The response message containing the greetings

func (*VerificationResponse) Descriptor

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

func (*VerificationResponse) GetCommon

func (m *VerificationResponse) GetCommon() *CommonResponse

func (*VerificationResponse) ProtoMessage

func (*VerificationResponse) ProtoMessage()

func (*VerificationResponse) Reset

func (m *VerificationResponse) Reset()

func (*VerificationResponse) String

func (m *VerificationResponse) String() string

Jump to

Keyboard shortcuts

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