apistore

package
v0.0.0-...-cfd9f02 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package apistore is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAPIStoreHandler

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

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

func RegisterAPIStoreHandlerClient

func RegisterAPIStoreHandlerClient(ctx context.Context, mux *runtime.ServeMux, client APIStoreClient) error

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

func RegisterAPIStoreHandlerFromEndpoint

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

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

func RegisterAPIStoreServer

func RegisterAPIStoreServer(s *grpc.Server, srv APIStoreServer)

Types

type API

type API struct {
	APIID                string    `protobuf:"bytes,1,opt,name=APIID,proto3" json:"APIID,omitempty"`
	Name                 string    `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version              string    `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Methods              []*Method `protobuf:"bytes,4,rep,name=methods,proto3" json:"methods,omitempty"`
	Schemas              []*Ref    `protobuf:"bytes,5,rep,name=schemas,proto3" json:"schemas,omitempty"`
	Servers              []*Server `protobuf:"bytes,6,rep,name=servers,proto3" json:"servers,omitempty"`
	Title                string    `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*API) Descriptor

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

func (*API) GetAPIID

func (m *API) GetAPIID() string

func (*API) GetMethods

func (m *API) GetMethods() []*Method

func (*API) GetName

func (m *API) GetName() string

func (*API) GetSchemas

func (m *API) GetSchemas() []*Ref

func (*API) GetServers

func (m *API) GetServers() []*Server

func (*API) GetTitle

func (m *API) GetTitle() string

func (*API) GetVersion

func (m *API) GetVersion() string

func (*API) ProtoMessage

func (*API) ProtoMessage()

func (*API) Reset

func (m *API) Reset()

func (*API) String

func (m *API) String() string

func (*API) XXX_DiscardUnknown

func (m *API) XXX_DiscardUnknown()

func (*API) XXX_Marshal

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

func (*API) XXX_Merge

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

func (*API) XXX_Size

func (m *API) XXX_Size() int

func (*API) XXX_Unmarshal

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

type APIStoreClient

type APIStoreClient interface {
	// 导入API
	CreateAPI(ctx context.Context, in *OpenAPI, opts ...grpc.CallOption) (*CreateAPIRes, error)
}

APIStoreClient is the client API for APIStore service.

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

func NewAPIStoreClient

func NewAPIStoreClient(cc *grpc.ClientConn) APIStoreClient

type APIStoreServer

type APIStoreServer interface {
	// 导入API
	CreateAPI(context.Context, *OpenAPI) (*CreateAPIRes, error)
}

APIStoreServer is the server API for APIStore service.

type CreateAPIRes

type CreateAPIRes struct {
	Code                 string   `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg                  string   `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	API                  *API     `protobuf:"bytes,3,opt,name=API,proto3" json:"API,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateAPIRes) Descriptor

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

func (*CreateAPIRes) GetAPI

func (m *CreateAPIRes) GetAPI() *API

func (*CreateAPIRes) GetCode

func (m *CreateAPIRes) GetCode() string

func (*CreateAPIRes) GetMsg

func (m *CreateAPIRes) GetMsg() string

func (*CreateAPIRes) ProtoMessage

func (*CreateAPIRes) ProtoMessage()

func (*CreateAPIRes) Reset

func (m *CreateAPIRes) Reset()

func (*CreateAPIRes) String

func (m *CreateAPIRes) String() string

func (*CreateAPIRes) XXX_DiscardUnknown

func (m *CreateAPIRes) XXX_DiscardUnknown()

func (*CreateAPIRes) XXX_Marshal

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

func (*CreateAPIRes) XXX_Merge

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

func (*CreateAPIRes) XXX_Size

func (m *CreateAPIRes) XXX_Size() int

func (*CreateAPIRes) XXX_Unmarshal

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

type Data

type Data struct {
	Params               string   `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
	Return               string   `protobuf:"bytes,2,opt,name=return,proto3" json:"return,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Data) Descriptor

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

func (*Data) GetParams

func (m *Data) GetParams() string

func (*Data) GetReturn

func (m *Data) GetReturn() string

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) Reset

func (m *Data) Reset()

func (*Data) String

func (m *Data) String() string

func (*Data) XXX_DiscardUnknown

func (m *Data) XXX_DiscardUnknown()

func (*Data) XXX_Marshal

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

func (*Data) XXX_Merge

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

func (*Data) XXX_Size

func (m *Data) XXX_Size() int

func (*Data) XXX_Unmarshal

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

type Method

type Method struct {
	MethodID             string   `protobuf:"bytes,1,opt,name=methodID,proto3" json:"methodID,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Description          string   `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Data                 *Data    `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	RefNames             []string `protobuf:"bytes,5,rep,name=refNames,proto3" json:"refNames,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Method) Descriptor

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

func (*Method) GetData

func (m *Method) GetData() *Data

func (*Method) GetDescription

func (m *Method) GetDescription() string

func (*Method) GetMethodID

func (m *Method) GetMethodID() string

func (*Method) GetName

func (m *Method) GetName() string

func (*Method) GetRefNames

func (m *Method) GetRefNames() []string

func (*Method) ProtoMessage

func (*Method) ProtoMessage()

func (*Method) Reset

func (m *Method) Reset()

func (*Method) String

func (m *Method) String() string

func (*Method) XXX_DiscardUnknown

func (m *Method) XXX_DiscardUnknown()

func (*Method) XXX_Marshal

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

func (*Method) XXX_Merge

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

func (*Method) XXX_Size

func (m *Method) XXX_Size() int

func (*Method) XXX_Unmarshal

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

type OpenAPI

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

func (*OpenAPI) Descriptor

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

func (*OpenAPI) GetContent

func (m *OpenAPI) GetContent() string

func (*OpenAPI) ProtoMessage

func (*OpenAPI) ProtoMessage()

func (*OpenAPI) Reset

func (m *OpenAPI) Reset()

func (*OpenAPI) String

func (m *OpenAPI) String() string

func (*OpenAPI) XXX_DiscardUnknown

func (m *OpenAPI) XXX_DiscardUnknown()

func (*OpenAPI) XXX_Marshal

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

func (*OpenAPI) XXX_Merge

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

func (*OpenAPI) XXX_Size

func (m *OpenAPI) XXX_Size() int

func (*OpenAPI) XXX_Unmarshal

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

type Ref

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

func (*Ref) Descriptor

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

func (*Ref) GetName

func (m *Ref) GetName() string

func (*Ref) GetSchema

func (m *Ref) GetSchema() string

func (*Ref) ProtoMessage

func (*Ref) ProtoMessage()

func (*Ref) Reset

func (m *Ref) Reset()

func (*Ref) String

func (m *Ref) String() string

func (*Ref) XXX_DiscardUnknown

func (m *Ref) XXX_DiscardUnknown()

func (*Ref) XXX_Marshal

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

func (*Ref) XXX_Merge

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

func (*Ref) XXX_Size

func (m *Ref) XXX_Size() int

func (*Ref) XXX_Unmarshal

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

type Server

type Server struct {
	Url                  string            `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Description          map[string]string `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Server) Descriptor

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

func (*Server) GetDescription

func (m *Server) GetDescription() map[string]string

func (*Server) GetUrl

func (m *Server) GetUrl() string

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) Reset

func (m *Server) Reset()

func (*Server) String

func (m *Server) String() string

func (*Server) XXX_DiscardUnknown

func (m *Server) XXX_DiscardUnknown()

func (*Server) XXX_Marshal

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

func (*Server) XXX_Merge

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

func (*Server) XXX_Size

func (m *Server) XXX_Size() int

func (*Server) XXX_Unmarshal

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

type UnimplementedAPIStoreServer

type UnimplementedAPIStoreServer struct {
}

UnimplementedAPIStoreServer can be embedded to have forward compatible implementations.

func (*UnimplementedAPIStoreServer) CreateAPI

Jump to

Keyboard shortcuts

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