basic

package
v4.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

This file is generated by protoc-gen-persist Source File: tests/sql/basic/basic.proto DO NOT EDIT !

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBidiStreamingPersistTx

func DefaultBidiStreamingPersistTx(ctx context.Context, db *sql.DB) (persist.PersistTx, error)

func DefaultClientStreamingPersistTx

func DefaultClientStreamingPersistTx(ctx context.Context, db *sql.DB) (persist.PersistTx, error)

func DefaultServerStreamingPersistTx

func DefaultServerStreamingPersistTx(ctx context.Context, db *sql.DB) (persist.PersistTx, error)

func DefaultUnaryPersistTx

func DefaultUnaryPersistTx(ctx context.Context, db *sql.DB) (persist.PersistTx, error)

func NopPersistTx

func NopPersistTx(r persist.Runnable) (persist.PersistTx, error)

func RegisterAmazingServer

func RegisterAmazingServer(s *grpc.Server, srv AmazingServer)

Types

type AmazingClient

type AmazingClient interface {
	UniarySelect(ctx context.Context, in *test.PartialTable, opts ...grpc.CallOption) (*test.ExampleTable, error)
	UniarySelectWithHooks(ctx context.Context, in *test.PartialTable, opts ...grpc.CallOption) (*test.ExampleTable, error)
	ServerStream(ctx context.Context, in *test.Name, opts ...grpc.CallOption) (Amazing_ServerStreamClient, error)
	ServerStreamWithHooks(ctx context.Context, in *test.Name, opts ...grpc.CallOption) (Amazing_ServerStreamWithHooksClient, error)
	ClientStream(ctx context.Context, opts ...grpc.CallOption) (Amazing_ClientStreamClient, error)
	ClientStreamWithHook(ctx context.Context, opts ...grpc.CallOption) (Amazing_ClientStreamWithHookClient, error)
	UnImplementedPersistMethod(ctx context.Context, in *test.ExampleTable, opts ...grpc.CallOption) (*test.ExampleTable, error)
	NoGenerationForBadReturnTypes(ctx context.Context, in *test.ExampleTable, opts ...grpc.CallOption) (*BadReturn, error)
}

AmazingClient is the client API for Amazing service.

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

func NewAmazingClient

func NewAmazingClient(cc *grpc.ClientConn) AmazingClient

type AmazingServer

type AmazingServer interface {
	UniarySelect(context.Context, *test.PartialTable) (*test.ExampleTable, error)
	UniarySelectWithHooks(context.Context, *test.PartialTable) (*test.ExampleTable, error)
	ServerStream(*test.Name, Amazing_ServerStreamServer) error
	ServerStreamWithHooks(*test.Name, Amazing_ServerStreamWithHooksServer) error
	ClientStream(Amazing_ClientStreamServer) error
	ClientStreamWithHook(Amazing_ClientStreamWithHookServer) error
	UnImplementedPersistMethod(context.Context, *test.ExampleTable) (*test.ExampleTable, error)
	NoGenerationForBadReturnTypes(context.Context, *test.ExampleTable) (*BadReturn, error)
}

AmazingServer is the server API for Amazing service.

type Amazing_ClientStreamClient

type Amazing_ClientStreamClient interface {
	Send(*test.ExampleTable) error
	CloseAndRecv() (*test.NumRows, error)
	grpc.ClientStream
}

type Amazing_ClientStreamServer

type Amazing_ClientStreamServer interface {
	SendAndClose(*test.NumRows) error
	Recv() (*test.ExampleTable, error)
	grpc.ServerStream
}

type Amazing_ClientStreamWithHookClient

type Amazing_ClientStreamWithHookClient interface {
	Send(*test.ExampleTable) error
	CloseAndRecv() (*test.Ids, error)
	grpc.ClientStream
}

type Amazing_ClientStreamWithHookServer

type Amazing_ClientStreamWithHookServer interface {
	SendAndClose(*test.Ids) error
	Recv() (*test.ExampleTable, error)
	grpc.ServerStream
}

type Amazing_ServerStreamClient

type Amazing_ServerStreamClient interface {
	Recv() (*test.ExampleTable, error)
	grpc.ClientStream
}

type Amazing_ServerStreamServer

type Amazing_ServerStreamServer interface {
	Send(*test.ExampleTable) error
	grpc.ServerStream
}

type Amazing_ServerStreamWithHooksClient

type Amazing_ServerStreamWithHooksClient interface {
	Recv() (*test.ExampleTable, error)
	grpc.ClientStream
}

type Amazing_ServerStreamWithHooksServer

type Amazing_ServerStreamWithHooksServer interface {
	Send(*test.ExampleTable) error
	grpc.ServerStream
}

type BadReturn

type BadReturn struct {
	No                   []*IntVal `protobuf:"bytes,1,rep,name=no,proto3" json:"no,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*BadReturn) Descriptor

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

func (*BadReturn) GetNo

func (m *BadReturn) GetNo() []*IntVal

func (*BadReturn) ProtoMessage

func (*BadReturn) ProtoMessage()

func (*BadReturn) Reset

func (m *BadReturn) Reset()

func (*BadReturn) String

func (m *BadReturn) String() string

func (*BadReturn) XXX_DiscardUnknown

func (m *BadReturn) XXX_DiscardUnknown()

func (*BadReturn) XXX_Marshal

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

func (*BadReturn) XXX_Merge

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

func (*BadReturn) XXX_Size

func (m *BadReturn) XXX_Size() int

func (*BadReturn) XXX_Unmarshal

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

type DefaultHooks_Amazing

type DefaultHooks_Amazing struct{}

func (*DefaultHooks_Amazing) ClientStreamWithHookAfterHook

func (*DefaultHooks_Amazing) ClientStreamWithHookAfterHook(context.Context, *test.ExampleTable, *test.Ids) error

func (*DefaultHooks_Amazing) ClientStreamWithHookBeforeHook

func (*DefaultHooks_Amazing) ClientStreamWithHookBeforeHook(context.Context, *test.ExampleTable) (*test.Ids, error)

func (*DefaultHooks_Amazing) ServerStreamWithHooksAfterHook

func (*DefaultHooks_Amazing) ServerStreamWithHooksAfterHook(context.Context, *test.Name, *test.ExampleTable) error

func (*DefaultHooks_Amazing) ServerStreamWithHooksBeforeHook

func (*DefaultHooks_Amazing) ServerStreamWithHooksBeforeHook(context.Context, *test.Name) (*test.ExampleTable, error)

func (*DefaultHooks_Amazing) UniarySelectWithHooksAfterHook

func (*DefaultHooks_Amazing) UniarySelectWithHooksAfterHook(context.Context, *test.PartialTable, *test.ExampleTable) error

func (*DefaultHooks_Amazing) UniarySelectWithHooksBeforeHook

func (*DefaultHooks_Amazing) UniarySelectWithHooksBeforeHook(context.Context, *test.PartialTable) (*test.ExampleTable, error)

type DefaultMappingImpl_Amazing_TimestampTimestamp

type DefaultMappingImpl_Amazing_TimestampTimestamp struct{}

func (*DefaultMappingImpl_Amazing_TimestampTimestamp) Scan

func (this *DefaultMappingImpl_Amazing_TimestampTimestamp) Scan(interface{}) error

func (*DefaultMappingImpl_Amazing_TimestampTimestamp) ToProto

func (*DefaultMappingImpl_Amazing_TimestampTimestamp) ToSql

func (*DefaultMappingImpl_Amazing_TimestampTimestamp) Value

type DefaultTypeMappings_Amazing

type DefaultTypeMappings_Amazing struct{}

func (*DefaultTypeMappings_Amazing) TimestampTimestamp

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) 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 Hooks_Amazing

type Hooks_Amazing interface {
	UniarySelectWithHooksBeforeHook(context.Context, *test.PartialTable) (*test.ExampleTable, error)
	ServerStreamWithHooksBeforeHook(context.Context, *test.Name) (*test.ExampleTable, error)
	ClientStreamWithHookBeforeHook(context.Context, *test.ExampleTable) (*test.Ids, error)
	UniarySelectWithHooksAfterHook(context.Context, *test.PartialTable, *test.ExampleTable) error
	ServerStreamWithHooksAfterHook(context.Context, *test.Name, *test.ExampleTable) error
	ClientStreamWithHookAfterHook(context.Context, *test.ExampleTable, *test.Ids) error
}

type Impl_Amazing

type Impl_Amazing struct {
	QUERIES  *Queries_Amazing
	HANDLERS RestOfHandlers_Amazing
	DB       *sql.DB
	// contains filtered or unexported fields
}

func ImplAmazing

func ImplAmazing(db *sql.DB, handlers RestOfHandlers_Amazing, opts ...Opts_Amazing) *Impl_Amazing

func (*Impl_Amazing) ClientStream

func (this *Impl_Amazing) ClientStream(stream Amazing_ClientStreamServer) error

func (*Impl_Amazing) ClientStreamTx

func (this *Impl_Amazing) ClientStreamTx(stream Amazing_ClientStreamServer, tx persist.PersistTx) error

func (*Impl_Amazing) ClientStreamWithHook

func (this *Impl_Amazing) ClientStreamWithHook(stream Amazing_ClientStreamWithHookServer) error

func (*Impl_Amazing) ClientStreamWithHookTx

func (this *Impl_Amazing) ClientStreamWithHookTx(stream Amazing_ClientStreamWithHookServer, tx persist.PersistTx) error

func (*Impl_Amazing) NoGenerationForBadReturnTypes

func (this *Impl_Amazing) NoGenerationForBadReturnTypes(ctx context.Context, req *test.ExampleTable) (*BadReturn, error)

func (*Impl_Amazing) ServerStream

func (this *Impl_Amazing) ServerStream(req *test.Name, stream Amazing_ServerStreamServer) error

func (*Impl_Amazing) ServerStreamTx

func (this *Impl_Amazing) ServerStreamTx(req *test.Name, stream Amazing_ServerStreamServer, tx persist.PersistTx) error

func (*Impl_Amazing) ServerStreamWithHooks

func (this *Impl_Amazing) ServerStreamWithHooks(req *test.Name, stream Amazing_ServerStreamWithHooksServer) error

func (*Impl_Amazing) ServerStreamWithHooksTx

func (this *Impl_Amazing) ServerStreamWithHooksTx(req *test.Name, stream Amazing_ServerStreamWithHooksServer, tx persist.PersistTx) error

func (*Impl_Amazing) UnImplementedPersistMethod

func (this *Impl_Amazing) UnImplementedPersistMethod(ctx context.Context, req *test.ExampleTable) (*test.ExampleTable, error)

func (*Impl_Amazing) UniarySelect

func (this *Impl_Amazing) UniarySelect(ctx context.Context, req *test.PartialTable) (*test.ExampleTable, error)

func (*Impl_Amazing) UniarySelectWithHooks

func (this *Impl_Amazing) UniarySelectWithHooks(ctx context.Context, req *test.PartialTable) (*test.ExampleTable, error)

type In_Amazing_Insert

type In_Amazing_Insert interface {
	GetId() int64
	GetStartTime() *timestamp.Timestamp
	GetName() string
}

type In_Amazing_SelectById

type In_Amazing_SelectById interface {
	GetId() int64
	GetStartTime() *timestamp.Timestamp
}

type In_Amazing_SelectByName

type In_Amazing_SelectByName interface {
	GetName() string
}

type IntVal

type IntVal struct {
	Val                  int64    `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*IntVal) Descriptor

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

func (*IntVal) GetVal

func (m *IntVal) GetVal() int64

func (*IntVal) ProtoMessage

func (*IntVal) ProtoMessage()

func (*IntVal) Reset

func (m *IntVal) Reset()

func (*IntVal) String

func (m *IntVal) String() string

func (*IntVal) XXX_DiscardUnknown

func (m *IntVal) XXX_DiscardUnknown()

func (*IntVal) XXX_Marshal

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

func (*IntVal) XXX_Merge

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

func (*IntVal) XXX_Size

func (m *IntVal) XXX_Size() int

func (*IntVal) XXX_Unmarshal

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

type Iter_Amazing_Insert

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

func (*Iter_Amazing_Insert) Columns

func (r *Iter_Amazing_Insert) Columns() ([]string, error)

returns the known columns for this result

func (*Iter_Amazing_Insert) Each

func (this *Iter_Amazing_Insert) Each(fun func(*Row_Amazing_Insert) error) error

Each performs 'fun' on each row in the result set. Each respects the context passed to it. It will stop iteration, and returns this.ctx.Err() if encountered.

func (*Iter_Amazing_Insert) IterInTypeTestExampleTable

func (this *Iter_Amazing_Insert) IterInTypeTestExampleTable()

func (*Iter_Amazing_Insert) IterOutTypeEmpty

func (this *Iter_Amazing_Insert) IterOutTypeEmpty()

func (*Iter_Amazing_Insert) Next

func (this *Iter_Amazing_Insert) Next() (*Row_Amazing_Insert, bool)

Next returns the next scanned row out of the database, or (nil, false) if there are no more rows

func (*Iter_Amazing_Insert) One

One returns the sole row, or ensures an error if there was not one result when this row is converted

func (*Iter_Amazing_Insert) Slice

func (this *Iter_Amazing_Insert) Slice() []*Row_Amazing_Insert

Slice returns all rows found in the iterator as a Slice.

func (*Iter_Amazing_Insert) Zero

func (this *Iter_Amazing_Insert) Zero() error

Zero returns an error if there were any rows in the result

type Iter_Amazing_SelectById

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

func (*Iter_Amazing_SelectById) Columns

func (r *Iter_Amazing_SelectById) Columns() ([]string, error)

returns the known columns for this result

func (*Iter_Amazing_SelectById) Each

Each performs 'fun' on each row in the result set. Each respects the context passed to it. It will stop iteration, and returns this.ctx.Err() if encountered.

func (*Iter_Amazing_SelectById) IterInTypeTestPartialTable

func (this *Iter_Amazing_SelectById) IterInTypeTestPartialTable()

func (*Iter_Amazing_SelectById) IterOutTypeTestExampleTable

func (this *Iter_Amazing_SelectById) IterOutTypeTestExampleTable()

func (*Iter_Amazing_SelectById) Next

Next returns the next scanned row out of the database, or (nil, false) if there are no more rows

func (*Iter_Amazing_SelectById) One

One returns the sole row, or ensures an error if there was not one result when this row is converted

func (*Iter_Amazing_SelectById) Slice

Slice returns all rows found in the iterator as a Slice.

func (*Iter_Amazing_SelectById) Zero

func (this *Iter_Amazing_SelectById) Zero() error

Zero returns an error if there were any rows in the result

type Iter_Amazing_SelectByName

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

func (*Iter_Amazing_SelectByName) Columns

func (r *Iter_Amazing_SelectByName) Columns() ([]string, error)

returns the known columns for this result

func (*Iter_Amazing_SelectByName) Each

Each performs 'fun' on each row in the result set. Each respects the context passed to it. It will stop iteration, and returns this.ctx.Err() if encountered.

func (*Iter_Amazing_SelectByName) IterInTypeTestName

func (this *Iter_Amazing_SelectByName) IterInTypeTestName()

func (*Iter_Amazing_SelectByName) IterOutTypeTestExampleTable

func (this *Iter_Amazing_SelectByName) IterOutTypeTestExampleTable()

func (*Iter_Amazing_SelectByName) Next

Next returns the next scanned row out of the database, or (nil, false) if there are no more rows

func (*Iter_Amazing_SelectByName) One

One returns the sole row, or ensures an error if there was not one result when this row is converted

func (*Iter_Amazing_SelectByName) Slice

Slice returns all rows found in the iterator as a Slice.

func (*Iter_Amazing_SelectByName) Zero

func (this *Iter_Amazing_SelectByName) Zero() error

Zero returns an error if there were any rows in the result

type MappingImpl_Amazing_TimestampTimestamp

type MappingImpl_Amazing_TimestampTimestamp interface {
	ToProto(**timestamp.Timestamp) error
	ToSql(*timestamp.Timestamp) sql.Scanner
	sql.Scanner
	driver.Valuer
}

type Opts_Amazing

type Opts_Amazing struct {
	MAPPINGS TypeMappings_Amazing
	HOOKS    Hooks_Amazing
}

func OptsAmazing

func OptsAmazing(hooks Hooks_Amazing, mappings TypeMappings_Amazing) Opts_Amazing

type Out_Amazing_Insert

type Out_Amazing_Insert interface {
}

type Out_Amazing_SelectById

type Out_Amazing_SelectById interface {
	GetId() int64
	GetStartTime() *timestamp.Timestamp
	GetName() string
}

type Out_Amazing_SelectByName

type Out_Amazing_SelectByName interface {
	GetId() int64
	GetStartTime() *timestamp.Timestamp
	GetName() string
}

type Queries_Amazing

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

Queries_Amazing holds all the queries found the proto service option as methods

func QueriesAmazing

func QueriesAmazing(opts ...Opts_Amazing) *Queries_Amazing

QueriesAmazing returns all the known 'SQL' queires for the 'Amazing' service. If no opts are provided default implementations are used.

func (*Queries_Amazing) Insert

Insert returns a struct that will perform the 'insert' query. When Execute is called, it will use the following fields: [id start_time name]

func (*Queries_Amazing) SelectById

SelectById returns a struct that will perform the 'select_by_id' query. When Execute is called, it will use the following fields: [id start_time]

func (*Queries_Amazing) SelectByName

SelectByName returns a struct that will perform the 'select_by_name' query. When Execute is called, it will use the following fields: [name]

type Query_Amazing_Insert

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

Query_Amazing_Insert (future doc string needed)

func (*Query_Amazing_Insert) Execute

Executes the query 'insert' with parameters retrieved from x. Fields used: [id start_time name]

func (*Query_Amazing_Insert) QueryInType_ExampleTable

func (this *Query_Amazing_Insert) QueryInType_ExampleTable()

func (*Query_Amazing_Insert) QueryOutType_Empty

func (this *Query_Amazing_Insert) QueryOutType_Empty()

type Query_Amazing_SelectById

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

Query_Amazing_SelectById (future doc string needed)

func (*Query_Amazing_SelectById) Execute

Executes the query 'select_by_id' with parameters retrieved from x. Fields used: [id start_time]

func (*Query_Amazing_SelectById) QueryInType_PartialTable

func (this *Query_Amazing_SelectById) QueryInType_PartialTable()

func (*Query_Amazing_SelectById) QueryOutType_ExampleTable

func (this *Query_Amazing_SelectById) QueryOutType_ExampleTable()

type Query_Amazing_SelectByName

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

Query_Amazing_SelectByName (future doc string needed)

func (*Query_Amazing_SelectByName) Execute

Executes the query 'select_by_name' with parameters retrieved from x. Fields used: [name]

func (*Query_Amazing_SelectByName) QueryInType_Name

func (this *Query_Amazing_SelectByName) QueryInType_Name()

func (*Query_Amazing_SelectByName) QueryOutType_ExampleTable

func (this *Query_Amazing_SelectByName) QueryOutType_ExampleTable()

type RestOfHandlers_Amazing

type RestOfHandlers_Amazing interface {
	UnImplementedPersistMethod(context.Context, *test.ExampleTable) (*test.ExampleTable, error)
	NoGenerationForBadReturnTypes(context.Context, *test.ExampleTable) (*BadReturn, error)
}

type Row_Amazing_Insert

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

func (*Row_Amazing_Insert) Empty

func (this *Row_Amazing_Insert) Empty() (*Empty, error)

func (*Row_Amazing_Insert) Proto

func (this *Row_Amazing_Insert) Proto() (*Empty, error)

func (*Row_Amazing_Insert) TestIds

func (this *Row_Amazing_Insert) TestIds() (*test.Ids, error)

func (*Row_Amazing_Insert) TestNumRows

func (this *Row_Amazing_Insert) TestNumRows() (*test.NumRows, error)

func (*Row_Amazing_Insert) Unwrap

func (this *Row_Amazing_Insert) Unwrap(pointerToMsg proto.Message) error

Unwrap takes an address to a proto.Message as its only parameter Unwrap can only set into output protos of that match method return types + the out option on the query itself

type Row_Amazing_SelectById

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

func (*Row_Amazing_SelectById) Proto

func (this *Row_Amazing_SelectById) Proto() (*test.ExampleTable, error)

func (*Row_Amazing_SelectById) TestExampleTable

func (this *Row_Amazing_SelectById) TestExampleTable() (*test.ExampleTable, error)

func (*Row_Amazing_SelectById) Unwrap

func (this *Row_Amazing_SelectById) Unwrap(pointerToMsg proto.Message) error

Unwrap takes an address to a proto.Message as its only parameter Unwrap can only set into output protos of that match method return types + the out option on the query itself

type Row_Amazing_SelectByName

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

func (*Row_Amazing_SelectByName) Proto

func (this *Row_Amazing_SelectByName) Proto() (*test.ExampleTable, error)

func (*Row_Amazing_SelectByName) TestExampleTable

func (this *Row_Amazing_SelectByName) TestExampleTable() (*test.ExampleTable, error)

func (*Row_Amazing_SelectByName) Unwrap

func (this *Row_Amazing_SelectByName) Unwrap(pointerToMsg proto.Message) error

Unwrap takes an address to a proto.Message as its only parameter Unwrap can only set into output protos of that match method return types + the out option on the query itself

type Runnable

type Runnable interface {
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
}

type TypeMappings_Amazing

type TypeMappings_Amazing interface {
	TimestampTimestamp() MappingImpl_Amazing_TimestampTimestamp
}

Jump to

Keyboard shortcuts

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