v1

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Schema_FieldType_name = map[int32]string{
		0: "INT64",
		1: "FLOAT64",
		2: "STRING",
		3: "BOOL",
		4: "TIMESTAMP",
	}
	Schema_FieldType_value = map[string]int32{
		"INT64":     0,
		"FLOAT64":   1,
		"STRING":    2,
		"BOOL":      3,
		"TIMESTAMP": 4,
	}
)

Enum value maps for Schema_FieldType.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_vince_import_v1_import_proto protoreflect.FileDescriptor
View Source
var Import_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Import",
	HandlerType: (*ImportServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Import",
			Handler:    _Import_Import_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vince/import/v1/import.proto",
}

Import_ServiceDesc is the grpc.ServiceDesc for Import service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterImportHandler

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

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

func RegisterImportHandlerClient

func RegisterImportHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ImportClient) error

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

func RegisterImportHandlerFromEndpoint

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

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

func RegisterImportHandlerServer

func RegisterImportHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ImportServer) error

RegisterImportHandlerServer registers the http handlers for service Import to "mux". UnaryRPC :call ImportServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterImportHandlerFromEndpoint instead.

func RegisterImportServer

func RegisterImportServer(s grpc.ServiceRegistrar, srv ImportServer)

Types

type ImportClient

type ImportClient interface {
	Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error)
}

ImportClient is the client API for Import service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewImportClient

func NewImportClient(cc grpc.ClientConnInterface) ImportClient

type ImportData

type ImportData struct {
	Data      []byte                 `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	CreatedBy string                 `protobuf:"bytes,2,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportData) Descriptor deprecated

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

Deprecated: Use ImportData.ProtoReflect.Descriptor instead.

func (*ImportData) GetCreatedAt

func (x *ImportData) GetCreatedAt() *timestamppb.Timestamp

func (*ImportData) GetCreatedBy

func (x *ImportData) GetCreatedBy() string

func (*ImportData) GetData

func (x *ImportData) GetData() []byte

func (*ImportData) MarshalToSizedBufferVT

func (m *ImportData) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ImportData) MarshalToVT

func (m *ImportData) MarshalToVT(dAtA []byte) (int, error)

func (*ImportData) MarshalVT

func (m *ImportData) MarshalVT() (dAtA []byte, err error)

func (*ImportData) ProtoMessage

func (*ImportData) ProtoMessage()

func (*ImportData) ProtoReflect

func (x *ImportData) ProtoReflect() protoreflect.Message

func (*ImportData) Reset

func (x *ImportData) Reset()

func (*ImportData) SizeVT

func (m *ImportData) SizeVT() (n int)

func (*ImportData) String

func (x *ImportData) String() string

func (*ImportData) UnmarshalVT

func (m *ImportData) UnmarshalVT(dAtA []byte) error

type ImportRequest

type ImportRequest struct {
	Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"`
	Csv    []byte  `protobuf:"bytes,2,opt,name=csv,proto3" json:"csv,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportRequest) Descriptor deprecated

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

Deprecated: Use ImportRequest.ProtoReflect.Descriptor instead.

func (*ImportRequest) GetCsv

func (x *ImportRequest) GetCsv() []byte

func (*ImportRequest) GetSchema

func (x *ImportRequest) GetSchema() *Schema

func (*ImportRequest) MarshalToSizedBufferVT

func (m *ImportRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ImportRequest) MarshalToVT

func (m *ImportRequest) MarshalToVT(dAtA []byte) (int, error)

func (*ImportRequest) MarshalVT

func (m *ImportRequest) MarshalVT() (dAtA []byte, err error)

func (*ImportRequest) ProtoMessage

func (*ImportRequest) ProtoMessage()

func (*ImportRequest) ProtoReflect

func (x *ImportRequest) ProtoReflect() protoreflect.Message

func (*ImportRequest) Reset

func (x *ImportRequest) Reset()

func (*ImportRequest) SizeVT

func (m *ImportRequest) SizeVT() (n int)

func (*ImportRequest) String

func (x *ImportRequest) String() string

func (*ImportRequest) UnmarshalVT

func (m *ImportRequest) UnmarshalVT(dAtA []byte) error

type ImportResponse

type ImportResponse struct {
	// contains filtered or unexported fields
}

func (*ImportResponse) Descriptor deprecated

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

Deprecated: Use ImportResponse.ProtoReflect.Descriptor instead.

func (*ImportResponse) MarshalToSizedBufferVT

func (m *ImportResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ImportResponse) MarshalToVT

func (m *ImportResponse) MarshalToVT(dAtA []byte) (int, error)

func (*ImportResponse) MarshalVT

func (m *ImportResponse) MarshalVT() (dAtA []byte, err error)

func (*ImportResponse) ProtoMessage

func (*ImportResponse) ProtoMessage()

func (*ImportResponse) ProtoReflect

func (x *ImportResponse) ProtoReflect() protoreflect.Message

func (*ImportResponse) Reset

func (x *ImportResponse) Reset()

func (*ImportResponse) SizeVT

func (m *ImportResponse) SizeVT() (n int)

func (*ImportResponse) String

func (x *ImportResponse) String() string

func (*ImportResponse) UnmarshalVT

func (m *ImportResponse) UnmarshalVT(dAtA []byte) error

type ImportServer

type ImportServer interface {
	Import(context.Context, *ImportRequest) (*ImportResponse, error)
	// contains filtered or unexported methods
}

ImportServer is the server API for Import service. All implementations must embed UnimplementedImportServer for forward compatibility

type Schema

type Schema struct {

	// The name of the schema. This serves as database table name when querying
	Name   string          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Fields []*Schema_Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
	// contains filtered or unexported fields
}

Schema defines the structure of a csv file. This maps directly to arrow schema, we limit the datatypes of fields to reflect the datatypes supported by the sites table schema.

Sites schema doesn't have bool fields, bool is included due to its useful nature when doing joins.

func (*Schema) Descriptor deprecated

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

Deprecated: Use Schema.ProtoReflect.Descriptor instead.

func (*Schema) GetFields

func (x *Schema) GetFields() []*Schema_Field

func (*Schema) GetName

func (x *Schema) GetName() string

func (*Schema) MarshalToSizedBufferVT

func (m *Schema) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Schema) MarshalToVT

func (m *Schema) MarshalToVT(dAtA []byte) (int, error)

func (*Schema) MarshalVT

func (m *Schema) MarshalVT() (dAtA []byte, err error)

func (*Schema) ProtoMessage

func (*Schema) ProtoMessage()

func (*Schema) ProtoReflect

func (x *Schema) ProtoReflect() protoreflect.Message

func (*Schema) Reset

func (x *Schema) Reset()

func (*Schema) SizeVT

func (m *Schema) SizeVT() (n int)

func (*Schema) String

func (x *Schema) String() string

func (*Schema) UnmarshalVT

func (m *Schema) UnmarshalVT(dAtA []byte) error

type Schema_Field

type Schema_Field struct {
	Type Schema_FieldType `protobuf:"varint,1,opt,name=type,proto3,enum=v1.Schema_FieldType" json:"type,omitempty"`
	Name string           `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Schema_Field) Descriptor deprecated

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

Deprecated: Use Schema_Field.ProtoReflect.Descriptor instead.

func (*Schema_Field) GetName

func (x *Schema_Field) GetName() string

func (*Schema_Field) GetType

func (x *Schema_Field) GetType() Schema_FieldType

func (*Schema_Field) MarshalToSizedBufferVT

func (m *Schema_Field) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Schema_Field) MarshalToVT

func (m *Schema_Field) MarshalToVT(dAtA []byte) (int, error)

func (*Schema_Field) MarshalVT

func (m *Schema_Field) MarshalVT() (dAtA []byte, err error)

func (*Schema_Field) ProtoMessage

func (*Schema_Field) ProtoMessage()

func (*Schema_Field) ProtoReflect

func (x *Schema_Field) ProtoReflect() protoreflect.Message

func (*Schema_Field) Reset

func (x *Schema_Field) Reset()

func (*Schema_Field) SizeVT

func (m *Schema_Field) SizeVT() (n int)

func (*Schema_Field) String

func (x *Schema_Field) String() string

func (*Schema_Field) UnmarshalVT

func (m *Schema_Field) UnmarshalVT(dAtA []byte) error

type Schema_FieldType

type Schema_FieldType int32
const (
	Schema_INT64     Schema_FieldType = 0
	Schema_FLOAT64   Schema_FieldType = 1
	Schema_STRING    Schema_FieldType = 2
	Schema_BOOL      Schema_FieldType = 3
	Schema_TIMESTAMP Schema_FieldType = 4
)

func (Schema_FieldType) Descriptor

func (Schema_FieldType) Enum

func (Schema_FieldType) EnumDescriptor deprecated

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

Deprecated: Use Schema_FieldType.Descriptor instead.

func (Schema_FieldType) Number

func (Schema_FieldType) String

func (x Schema_FieldType) String() string

func (Schema_FieldType) Type

type UnimplementedImportServer

type UnimplementedImportServer struct {
}

UnimplementedImportServer must be embedded to have forward compatible implementations.

func (UnimplementedImportServer) Import

type UnsafeImportServer

type UnsafeImportServer interface {
	// contains filtered or unexported methods
}

UnsafeImportServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ImportServer will result in compilation errors.

Jump to

Keyboard shortcuts

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