proto

package
v0.0.0-...-9c44629 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	BackendSwagger = `` /* 5519-byte string literal not displayed */

	ChemaSwagger = `` /* 270-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func RegisterBackendHandler

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

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

func RegisterBackendHandlerClient

func RegisterBackendHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BackendClient) error

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

func RegisterBackendHandlerFromEndpoint

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

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

func RegisterBackendServer

func RegisterBackendServer(s *grpc.Server, srv BackendServer)

Types

type BackendClient

type BackendClient interface {
	// Version
	Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
	// Create Schema
	CreateSchema(ctx context.Context, in *Schema, opts ...grpc.CallOption) (*Schema, error)
	// Get Schema
	GetSchema(ctx context.Context, in *RequestObjectById, opts ...grpc.CallOption) (*Schema, error)
	// CreateRecords
	CreateRecords(ctx context.Context, in *Records, opts ...grpc.CallOption) (*Records, error)
	// UpdateRecord
	UpdateRecord(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Record, error)
}

BackendClient is the client API for Backend service.

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

func NewBackendClient

func NewBackendClient(cc *grpc.ClientConn) BackendClient

type BackendServer

type BackendServer interface {
	// Version
	Version(context.Context, *empty.Empty) (*VersionResponse, error)
	// Create Schema
	CreateSchema(context.Context, *Schema) (*Schema, error)
	// Get Schema
	GetSchema(context.Context, *RequestObjectById) (*Schema, error)
	// CreateRecords
	CreateRecords(context.Context, *Records) (*Records, error)
	// UpdateRecord
	UpdateRecord(context.Context, *Record) (*Record, error)
}

BackendServer is the server API for Backend service.

type BooleanType

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

func (*BooleanType) Descriptor

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

func (*BooleanType) GetDescription

func (m *BooleanType) GetDescription() string

func (*BooleanType) GetType

func (m *BooleanType) GetType() string

func (*BooleanType) ProtoMessage

func (*BooleanType) ProtoMessage()

func (*BooleanType) Reset

func (m *BooleanType) Reset()

func (*BooleanType) String

func (m *BooleanType) String() string

func (*BooleanType) XXX_DiscardUnknown

func (m *BooleanType) XXX_DiscardUnknown()

func (*BooleanType) XXX_Marshal

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

func (*BooleanType) XXX_Merge

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

func (*BooleanType) XXX_Size

func (m *BooleanType) XXX_Size() int

func (*BooleanType) XXX_Unmarshal

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

type Column

type Column struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	MinLength            int32    `protobuf:"varint,2,opt,name=minLength,proto3" json:"minLength,omitempty"`
	MaxLength            int32    `protobuf:"varint,3,opt,name=maxLength,proto3" json:"maxLength,omitempty"`
	Minimum              int64    `protobuf:"varint,4,opt,name=minimum,proto3" json:"minimum,omitempty"`
	Maximum              int64    `protobuf:"varint,5,opt,name=maximum,proto3" json:"maximum,omitempty"`
	Default              *any.Any `protobuf:"bytes,6,opt,name=default,proto3" json:"default,omitempty"`
	Enum                 *any.Any `protobuf:"bytes,7,opt,name=enum,proto3" json:"enum,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Column) Descriptor

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

func (*Column) GetDefault

func (m *Column) GetDefault() *any.Any

func (*Column) GetEnum

func (m *Column) GetEnum() *any.Any

func (*Column) GetMaxLength

func (m *Column) GetMaxLength() int32

func (*Column) GetMaximum

func (m *Column) GetMaximum() int64

func (*Column) GetMinLength

func (m *Column) GetMinLength() int32

func (*Column) GetMinimum

func (m *Column) GetMinimum() int64

func (*Column) GetType

func (m *Column) GetType() string

func (*Column) ProtoMessage

func (*Column) ProtoMessage()

func (*Column) Reset

func (m *Column) Reset()

func (*Column) String

func (m *Column) String() string

func (*Column) XXX_DiscardUnknown

func (m *Column) XXX_DiscardUnknown()

func (*Column) XXX_Marshal

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

func (*Column) XXX_Merge

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

func (*Column) XXX_Size

func (m *Column) XXX_Size() int

func (*Column) XXX_Unmarshal

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

type DateTimeType

type DateTimeType struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Description          string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Default              string   `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
	Format               string   `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DateTimeType) Descriptor

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

func (*DateTimeType) GetDefault

func (m *DateTimeType) GetDefault() string

func (*DateTimeType) GetDescription

func (m *DateTimeType) GetDescription() string

func (*DateTimeType) GetFormat

func (m *DateTimeType) GetFormat() string

func (*DateTimeType) GetType

func (m *DateTimeType) GetType() string

func (*DateTimeType) ProtoMessage

func (*DateTimeType) ProtoMessage()

func (*DateTimeType) Reset

func (m *DateTimeType) Reset()

func (*DateTimeType) String

func (m *DateTimeType) String() string

func (*DateTimeType) XXX_DiscardUnknown

func (m *DateTimeType) XXX_DiscardUnknown()

func (*DateTimeType) XXX_Marshal

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

func (*DateTimeType) XXX_Merge

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

func (*DateTimeType) XXX_Size

func (m *DateTimeType) XXX_Size() int

func (*DateTimeType) XXX_Unmarshal

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

type FloatType

type FloatType struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Description          string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Minimum              float64  `protobuf:"fixed64,3,opt,name=minimum,proto3" json:"minimum,omitempty"`
	Maximum              float64  `protobuf:"fixed64,4,opt,name=maximum,proto3" json:"maximum,omitempty"`
	Default              float64  `protobuf:"fixed64,5,opt,name=default,proto3" json:"default,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FloatType) Descriptor

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

func (*FloatType) GetDefault

func (m *FloatType) GetDefault() float64

func (*FloatType) GetDescription

func (m *FloatType) GetDescription() string

func (*FloatType) GetMaximum

func (m *FloatType) GetMaximum() float64

func (*FloatType) GetMinimum

func (m *FloatType) GetMinimum() float64

func (*FloatType) GetType

func (m *FloatType) GetType() string

func (*FloatType) ProtoMessage

func (*FloatType) ProtoMessage()

func (*FloatType) Reset

func (m *FloatType) Reset()

func (*FloatType) String

func (m *FloatType) String() string

func (*FloatType) XXX_DiscardUnknown

func (m *FloatType) XXX_DiscardUnknown()

func (*FloatType) XXX_Marshal

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

func (*FloatType) XXX_Merge

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

func (*FloatType) XXX_Size

func (m *FloatType) XXX_Size() int

func (*FloatType) XXX_Unmarshal

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

type IntegerType

type IntegerType struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Description          string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Minimum              int64    `protobuf:"varint,3,opt,name=minimum,proto3" json:"minimum,omitempty"`
	Maximum              int64    `protobuf:"varint,4,opt,name=maximum,proto3" json:"maximum,omitempty"`
	Default              int64    `protobuf:"varint,5,opt,name=default,proto3" json:"default,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*IntegerType) Descriptor

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

func (*IntegerType) GetDefault

func (m *IntegerType) GetDefault() int64

func (*IntegerType) GetDescription

func (m *IntegerType) GetDescription() string

func (*IntegerType) GetMaximum

func (m *IntegerType) GetMaximum() int64

func (*IntegerType) GetMinimum

func (m *IntegerType) GetMinimum() int64

func (*IntegerType) GetType

func (m *IntegerType) GetType() string

func (*IntegerType) ProtoMessage

func (*IntegerType) ProtoMessage()

func (*IntegerType) Reset

func (m *IntegerType) Reset()

func (*IntegerType) String

func (m *IntegerType) String() string

func (*IntegerType) XXX_DiscardUnknown

func (m *IntegerType) XXX_DiscardUnknown()

func (*IntegerType) XXX_Marshal

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

func (*IntegerType) XXX_Merge

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

func (*IntegerType) XXX_Size

func (m *IntegerType) XXX_Size() int

func (*IntegerType) XXX_Unmarshal

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

type Record

type Record struct {
	Id                   string          `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Fields               *_struct.Struct `protobuf:"bytes,2,opt,name=fields,proto3" json:"fields,omitempty"`
	ProjectID            string          `protobuf:"bytes,3,opt,name=projectID,proto3" json:"projectID,omitempty"`
	SchemaID             string          `protobuf:"bytes,4,opt,name=schemaID,proto3" json:"schemaID,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Record) Descriptor

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

func (*Record) GetFields

func (m *Record) GetFields() *_struct.Struct

func (*Record) GetId

func (m *Record) GetId() string

func (*Record) GetProjectID

func (m *Record) GetProjectID() string

func (*Record) GetSchemaID

func (m *Record) GetSchemaID() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) String

func (m *Record) String() string

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

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

func (*Record) XXX_Merge

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

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

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

type Records

type Records struct {
	ProjectID            string    `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"`
	SchemaID             string    `protobuf:"bytes,2,opt,name=schemaID,proto3" json:"schemaID,omitempty"`
	Records              []*Record `protobuf:"bytes,3,rep,name=records,proto3" json:"records,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Records) Descriptor

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

func (*Records) GetProjectID

func (m *Records) GetProjectID() string

func (*Records) GetRecords

func (m *Records) GetRecords() []*Record

func (*Records) GetSchemaID

func (m *Records) GetSchemaID() string

func (*Records) ProtoMessage

func (*Records) ProtoMessage()

func (*Records) Reset

func (m *Records) Reset()

func (*Records) String

func (m *Records) String() string

func (*Records) XXX_DiscardUnknown

func (m *Records) XXX_DiscardUnknown()

func (*Records) XXX_Marshal

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

func (*Records) XXX_Merge

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

func (*Records) XXX_Size

func (m *Records) XXX_Size() int

func (*Records) XXX_Unmarshal

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

type RequestObjectById

type RequestObjectById 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:"-"`
}

func (*RequestObjectById) Descriptor

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

func (*RequestObjectById) GetId

func (m *RequestObjectById) GetId() string

func (*RequestObjectById) ProtoMessage

func (*RequestObjectById) ProtoMessage()

func (*RequestObjectById) Reset

func (m *RequestObjectById) Reset()

func (*RequestObjectById) String

func (m *RequestObjectById) String() string

func (*RequestObjectById) XXX_DiscardUnknown

func (m *RequestObjectById) XXX_DiscardUnknown()

func (*RequestObjectById) XXX_Marshal

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

func (*RequestObjectById) XXX_Merge

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

func (*RequestObjectById) XXX_Size

func (m *RequestObjectById) XXX_Size() int

func (*RequestObjectById) XXX_Unmarshal

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

type Schema

type Schema struct {
	Id                   string                     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Properties           map[string]*_struct.Struct `` /* 161-byte string literal not displayed */
	Required             []string                   `protobuf:"bytes,3,rep,name=required,proto3" json:"required,omitempty"`
	Name                 string                     `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	ProjectID            string                     `protobuf:"bytes,5,opt,name=projectID,proto3" json:"projectID,omitempty"`
	Version              string                     `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

func (*Schema) Descriptor

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

func (*Schema) GetId

func (m *Schema) GetId() string

func (*Schema) GetName

func (m *Schema) GetName() string

func (*Schema) GetProjectID

func (m *Schema) GetProjectID() string

func (*Schema) GetProperties

func (m *Schema) GetProperties() map[string]*_struct.Struct

func (*Schema) GetRequired

func (m *Schema) GetRequired() []string

func (*Schema) GetVersion

func (m *Schema) GetVersion() string

func (*Schema) ProtoMessage

func (*Schema) ProtoMessage()

func (*Schema) Reset

func (m *Schema) Reset()

func (*Schema) String

func (m *Schema) String() string

func (*Schema) XXX_DiscardUnknown

func (m *Schema) XXX_DiscardUnknown()

func (*Schema) XXX_Marshal

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

func (*Schema) XXX_Merge

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

func (*Schema) XXX_Size

func (m *Schema) XXX_Size() int

func (*Schema) XXX_Unmarshal

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

type StringType

type StringType struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Description          string   `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	MinLength            int32    `protobuf:"varint,3,opt,name=minLength,proto3" json:"minLength,omitempty"`
	MaxLength            int32    `protobuf:"varint,4,opt,name=maxLength,proto3" json:"maxLength,omitempty"`
	Default              string   `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StringType) Descriptor

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

func (*StringType) GetDefault

func (m *StringType) GetDefault() string

func (*StringType) GetDescription

func (m *StringType) GetDescription() string

func (*StringType) GetMaxLength

func (m *StringType) GetMaxLength() int32

func (*StringType) GetMinLength

func (m *StringType) GetMinLength() int32

func (*StringType) GetType

func (m *StringType) GetType() string

func (*StringType) ProtoMessage

func (*StringType) ProtoMessage()

func (*StringType) Reset

func (m *StringType) Reset()

func (*StringType) String

func (m *StringType) String() string

func (*StringType) XXX_DiscardUnknown

func (m *StringType) XXX_DiscardUnknown()

func (*StringType) XXX_Marshal

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

func (*StringType) XXX_Merge

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

func (*StringType) XXX_Size

func (m *StringType) XXX_Size() int

func (*StringType) XXX_Unmarshal

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

type UnimplementedBackendServer

type UnimplementedBackendServer struct {
}

UnimplementedBackendServer can be embedded to have forward compatible implementations.

func (*UnimplementedBackendServer) CreateRecords

func (*UnimplementedBackendServer) CreateRecords(ctx context.Context, req *Records) (*Records, error)

func (*UnimplementedBackendServer) CreateSchema

func (*UnimplementedBackendServer) CreateSchema(ctx context.Context, req *Schema) (*Schema, error)

func (*UnimplementedBackendServer) GetSchema

func (*UnimplementedBackendServer) UpdateRecord

func (*UnimplementedBackendServer) UpdateRecord(ctx context.Context, req *Record) (*Record, error)

func (*UnimplementedBackendServer) Version

type VersionResponse

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

func (*VersionResponse) Descriptor

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

func (*VersionResponse) GetValue

func (m *VersionResponse) GetValue() string

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) Reset

func (m *VersionResponse) Reset()

func (*VersionResponse) String

func (m *VersionResponse) String() string

func (*VersionResponse) XXX_DiscardUnknown

func (m *VersionResponse) XXX_DiscardUnknown()

func (*VersionResponse) XXX_Marshal

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

func (*VersionResponse) XXX_Merge

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

func (*VersionResponse) XXX_Size

func (m *VersionResponse) XXX_Size() int

func (*VersionResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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