api_v1_catosniff

package
v0.0.0-...-f14c619 Latest Latest
Warning

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

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

Documentation

Overview

Package api_v1_catosniff is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var ResponseStateCode_name = map[int32]string{
	0: "CREATED",
}
View Source
var ResponseStateCode_value = map[string]int32{
	"CREATED": 0,
}

Functions

func RegisterCatOSniffAPIServiceHandler

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

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

func RegisterCatOSniffAPIServiceHandlerClient

func RegisterCatOSniffAPIServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CatOSniffAPIServiceClient) error

RegisterCatOSniffAPIServiceHandlerClient registers the http handlers for service CatOSniffAPIService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CatOSniffAPIServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CatOSniffAPIServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CatOSniffAPIServiceClient" to call the correct interceptors.

func RegisterCatOSniffAPIServiceHandlerFromEndpoint

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

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

func RegisterCatOSniffAPIServiceHandlerServer

func RegisterCatOSniffAPIServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CatOSniffAPIServiceServer) error

RegisterCatOSniffAPIServiceHandlerServer registers the http handlers for service CatOSniffAPIService to "mux". UnaryRPC :call CatOSniffAPIServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterCatOSniffAPIServiceServer

func RegisterCatOSniffAPIServiceServer(s *grpc.Server, srv CatOSniffAPIServiceServer)

Types

type Answer

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

func (*Answer) Descriptor

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

func (*Answer) GetAnswer

func (m *Answer) GetAnswer() string

func (*Answer) GetId

func (m *Answer) GetId() int32

func (*Answer) ProtoMessage

func (*Answer) ProtoMessage()

func (*Answer) Reset

func (m *Answer) Reset()

func (*Answer) String

func (m *Answer) String() string

func (*Answer) Validate

func (this *Answer) Validate() error

func (*Answer) XXX_DiscardUnknown

func (m *Answer) XXX_DiscardUnknown()

func (*Answer) XXX_Marshal

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

func (*Answer) XXX_Merge

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

func (*Answer) XXX_Size

func (m *Answer) XXX_Size() int

func (*Answer) XXX_Unmarshal

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

type CatOSniffAPIServiceClient

type CatOSniffAPIServiceClient interface {
	SaveQuestion(ctx context.Context, in *SaveQuestionRequest, opts ...grpc.CallOption) (*SaveQuestionResponse, error)
	HealthCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

CatOSniffAPIServiceClient is the client API for CatOSniffAPIService service.

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

func NewCatOSniffAPIServiceClient

func NewCatOSniffAPIServiceClient(cc *grpc.ClientConn) CatOSniffAPIServiceClient

type CatOSniffAPIServiceServer

type CatOSniffAPIServiceServer interface {
	SaveQuestion(context.Context, *SaveQuestionRequest) (*SaveQuestionResponse, error)
	HealthCheck(context.Context, *Empty) (*HealthCheckResponse, error)
}

CatOSniffAPIServiceServer is the server API for CatOSniffAPIService service.

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Empty) Validate

func (this *Empty) Validate() error

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type HealthCheckResponse

type HealthCheckResponse struct {
	Active               bool     `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckResponse) Descriptor

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

func (*HealthCheckResponse) GetActive

func (m *HealthCheckResponse) GetActive() bool

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) Reset

func (m *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (m *HealthCheckResponse) String() string

func (*HealthCheckResponse) Validate

func (this *HealthCheckResponse) Validate() error

func (*HealthCheckResponse) XXX_DiscardUnknown

func (m *HealthCheckResponse) XXX_DiscardUnknown()

func (*HealthCheckResponse) XXX_Marshal

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

func (*HealthCheckResponse) XXX_Merge

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

func (*HealthCheckResponse) XXX_Size

func (m *HealthCheckResponse) XXX_Size() int

func (*HealthCheckResponse) XXX_Unmarshal

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

type ResponseStateCode

type ResponseStateCode int32
const (
	ResponseStateCode_CREATED ResponseStateCode = 0
)

func (ResponseStateCode) EnumDescriptor

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

func (ResponseStateCode) String

func (x ResponseStateCode) String() string

type SaveQuestionRequest

type SaveQuestionRequest struct {
	Id                   int32     `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Question             string    `protobuf:"bytes,2,opt,name=question,proto3" json:"question,omitempty"`
	Answer               []*Answer `protobuf:"bytes,3,rep,name=answer,proto3" json:"answer,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*SaveQuestionRequest) Descriptor

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

func (*SaveQuestionRequest) GetAnswer

func (m *SaveQuestionRequest) GetAnswer() []*Answer

func (*SaveQuestionRequest) GetId

func (m *SaveQuestionRequest) GetId() int32

func (*SaveQuestionRequest) GetQuestion

func (m *SaveQuestionRequest) GetQuestion() string

func (*SaveQuestionRequest) ProtoMessage

func (*SaveQuestionRequest) ProtoMessage()

func (*SaveQuestionRequest) Reset

func (m *SaveQuestionRequest) Reset()

func (*SaveQuestionRequest) String

func (m *SaveQuestionRequest) String() string

func (*SaveQuestionRequest) Validate

func (this *SaveQuestionRequest) Validate() error

func (*SaveQuestionRequest) XXX_DiscardUnknown

func (m *SaveQuestionRequest) XXX_DiscardUnknown()

func (*SaveQuestionRequest) XXX_Marshal

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

func (*SaveQuestionRequest) XXX_Merge

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

func (*SaveQuestionRequest) XXX_Size

func (m *SaveQuestionRequest) XXX_Size() int

func (*SaveQuestionRequest) XXX_Unmarshal

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

type SaveQuestionResponse

type SaveQuestionResponse struct {
	StateCode            ResponseStateCode `protobuf:"varint,1,opt,name=stateCode,proto3,enum=api.v1.catosniff.ResponseStateCode" json:"stateCode,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*SaveQuestionResponse) Descriptor

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

func (*SaveQuestionResponse) GetStateCode

func (m *SaveQuestionResponse) GetStateCode() ResponseStateCode

func (*SaveQuestionResponse) ProtoMessage

func (*SaveQuestionResponse) ProtoMessage()

func (*SaveQuestionResponse) Reset

func (m *SaveQuestionResponse) Reset()

func (*SaveQuestionResponse) String

func (m *SaveQuestionResponse) String() string

func (*SaveQuestionResponse) Validate

func (this *SaveQuestionResponse) Validate() error

func (*SaveQuestionResponse) XXX_DiscardUnknown

func (m *SaveQuestionResponse) XXX_DiscardUnknown()

func (*SaveQuestionResponse) XXX_Marshal

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

func (*SaveQuestionResponse) XXX_Merge

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

func (*SaveQuestionResponse) XXX_Size

func (m *SaveQuestionResponse) XXX_Size() int

func (*SaveQuestionResponse) XXX_Unmarshal

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

type UnimplementedCatOSniffAPIServiceServer

type UnimplementedCatOSniffAPIServiceServer struct {
}

UnimplementedCatOSniffAPIServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedCatOSniffAPIServiceServer) HealthCheck

func (*UnimplementedCatOSniffAPIServiceServer) SaveQuestion

Jump to

Keyboard shortcuts

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