Documentation
¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type BlobValue
- type BoolValue
- type Column
- type DatabaseService
- type ExecRequest
- func (*ExecRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecRequest) GetParameters() []*Value
- func (x *ExecRequest) GetSql() string
- func (*ExecRequest) ProtoMessage()
- func (x *ExecRequest) ProtoReflect() protoreflect.Message
- func (x *ExecRequest) Reset()
- func (x *ExecRequest) String() string
- type ExecResponse
- func (*ExecResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecResponse) GetLastInsertId() int64
- func (x *ExecResponse) GetRowsAffected() int64
- func (*ExecResponse) ProtoMessage()
- func (x *ExecResponse) ProtoReflect() protoreflect.Message
- func (x *ExecResponse) Reset()
- func (x *ExecResponse) String() string
- type HTTPClient
- type IntergerValue
- func (*IntergerValue) Descriptor() ([]byte, []int)deprecated
- func (x *IntergerValue) GetValid() bool
- func (x *IntergerValue) GetValue() int64
- func (*IntergerValue) ProtoMessage()
- func (x *IntergerValue) ProtoReflect() protoreflect.Message
- func (x *IntergerValue) Reset()
- func (x *IntergerValue) String() string
- type ListValue
- type NullValue
- type NumericValue
- func (*NumericValue) Descriptor() ([]byte, []int)deprecated
- func (x *NumericValue) GetValid() bool
- func (x *NumericValue) GetValue() float64
- func (*NumericValue) ProtoMessage()
- func (x *NumericValue) ProtoReflect() protoreflect.Message
- func (x *NumericValue) Reset()
- func (x *NumericValue) String() string
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetParameters() []*Value
- func (x *QueryRequest) GetSql() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResponse) GetColumns() []*Column
- func (x *QueryResponse) GetRows() []*ListValue
- func (*QueryResponse) ProtoMessage()
- func (x *QueryResponse) ProtoReflect() protoreflect.Message
- func (x *QueryResponse) Reset()
- func (x *QueryResponse) String() string
- type RealValue
- type TextValue
- type TimeValue
- type TwirpServer
- type Type
- type TypeCode
- type Value
- func (*Value) Descriptor() ([]byte, []int)deprecated
- func (x *Value) GetBlobValue() *BlobValue
- func (x *Value) GetBoolValue() *BoolValue
- func (x *Value) GetIntegerValue() *IntergerValue
- func (m *Value) GetKind() isValue_Kind
- func (x *Value) GetNullValue() *NullValue
- func (x *Value) GetNumericValue() *NumericValue
- func (x *Value) GetRealValue() *RealValue
- func (x *Value) GetTextValue() *TextValue
- func (x *Value) GetTimeValue() *TimeValue
- func (*Value) ProtoMessage()
- func (x *Value) ProtoReflect() protoreflect.Message
- func (x *Value) Reset()
- func (x *Value) String() string
- type Value_BlobValue
- type Value_BoolValue
- type Value_IntegerValue
- type Value_NullValue
- type Value_NumericValue
- type Value_RealValue
- type Value_TextValue
- type Value_TimeValue
Constants ¶
const DatabaseServicePathPrefix = "/twirp/sqlite.rpc.v0.DatabaseService/"
DatabaseServicePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var ( TypeCode_name = map[int32]string{ 0: "TYPE_CODE_UNSPECIFIED", 1: "TYPE_CODE_INTEGER", 2: "TYPE_CODE_TEXT", 3: "TYPE_CODE_BLOB", 4: "TYPE_CODE_REAL", 5: "TYPE_CODE_NUMERIC", 6: "TYPE_CODE_BOOL", 7: "TYPE_CODE_TIME", 8: "TYPE_CODE_NULL", } TypeCode_value = map[string]int32{ "TYPE_CODE_UNSPECIFIED": 0, "TYPE_CODE_INTEGER": 1, "TYPE_CODE_TEXT": 2, "TYPE_CODE_BLOB": 3, "TYPE_CODE_REAL": 4, "TYPE_CODE_NUMERIC": 5, "TYPE_CODE_BOOL": 6, "TYPE_CODE_TIME": 7, "TYPE_CODE_NULL": 8, } )
Enum value maps for TypeCode.
var File_sqlite_proto protoreflect.FileDescriptor
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
type BlobValue ¶
type BlobValue struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*BlobValue) Descriptor
deprecated
func (*BlobValue) ProtoMessage ¶
func (*BlobValue) ProtoMessage()
func (*BlobValue) ProtoReflect ¶
func (x *BlobValue) ProtoReflect() protoreflect.Message
type BoolValue ¶
type BoolValue struct { Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*BoolValue) Descriptor
deprecated
func (*BoolValue) ProtoMessage ¶
func (*BoolValue) ProtoMessage()
func (*BoolValue) ProtoReflect ¶
func (x *BoolValue) ProtoReflect() protoreflect.Message
type Column ¶
type Column struct { Type TypeCode `protobuf:"varint,1,opt,name=type,proto3,enum=sqlite.rpc.v0.TypeCode" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Column) Descriptor
deprecated
func (*Column) ProtoMessage ¶
func (*Column) ProtoMessage()
func (*Column) ProtoReflect ¶
func (x *Column) ProtoReflect() protoreflect.Message
type DatabaseService ¶
type DatabaseService interface { Exec(context.Context, *ExecRequest) (*ExecResponse, error) Query(context.Context, *QueryRequest) (*QueryResponse, error) }
func NewDatabaseServiceJSONClient ¶
func NewDatabaseServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) DatabaseService
NewDatabaseServiceJSONClient creates a JSON client that implements the DatabaseService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewDatabaseServiceProtobufClient ¶
func NewDatabaseServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) DatabaseService
NewDatabaseServiceProtobufClient creates a Protobuf client that implements the DatabaseService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type ExecRequest ¶
type ExecRequest struct { Sql string `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"` Parameters []*Value `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"` // contains filtered or unexported fields }
func (*ExecRequest) Descriptor
deprecated
func (*ExecRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead.
func (*ExecRequest) GetParameters ¶
func (x *ExecRequest) GetParameters() []*Value
func (*ExecRequest) GetSql ¶
func (x *ExecRequest) GetSql() string
func (*ExecRequest) ProtoMessage ¶
func (*ExecRequest) ProtoMessage()
func (*ExecRequest) ProtoReflect ¶
func (x *ExecRequest) ProtoReflect() protoreflect.Message
func (*ExecRequest) Reset ¶
func (x *ExecRequest) Reset()
func (*ExecRequest) String ¶
func (x *ExecRequest) String() string
type ExecResponse ¶
type ExecResponse struct { LastInsertId int64 `protobuf:"varint,1,opt,name=last_insert_id,json=lastInsertId,proto3" json:"last_insert_id,omitempty"` RowsAffected int64 `protobuf:"varint,2,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"` // contains filtered or unexported fields }
func (*ExecResponse) Descriptor
deprecated
func (*ExecResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead.
func (*ExecResponse) GetLastInsertId ¶
func (x *ExecResponse) GetLastInsertId() int64
func (*ExecResponse) GetRowsAffected ¶
func (x *ExecResponse) GetRowsAffected() int64
func (*ExecResponse) ProtoMessage ¶
func (*ExecResponse) ProtoMessage()
func (*ExecResponse) ProtoReflect ¶
func (x *ExecResponse) ProtoReflect() protoreflect.Message
func (*ExecResponse) Reset ¶
func (x *ExecResponse) Reset()
func (*ExecResponse) String ¶
func (x *ExecResponse) String() string
type HTTPClient ¶
HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.
HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.
type IntergerValue ¶
type IntergerValue struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*IntergerValue) Descriptor
deprecated
func (*IntergerValue) Descriptor() ([]byte, []int)
Deprecated: Use IntergerValue.ProtoReflect.Descriptor instead.
func (*IntergerValue) GetValid ¶
func (x *IntergerValue) GetValid() bool
func (*IntergerValue) GetValue ¶
func (x *IntergerValue) GetValue() int64
func (*IntergerValue) ProtoMessage ¶
func (*IntergerValue) ProtoMessage()
func (*IntergerValue) ProtoReflect ¶
func (x *IntergerValue) ProtoReflect() protoreflect.Message
func (*IntergerValue) Reset ¶
func (x *IntergerValue) Reset()
func (*IntergerValue) String ¶
func (x *IntergerValue) String() string
type ListValue ¶
type ListValue struct { // Repeated field of dynamically typed values. Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*ListValue) Descriptor
deprecated
func (*ListValue) ProtoMessage ¶
func (*ListValue) ProtoMessage()
func (*ListValue) ProtoReflect ¶
func (x *ListValue) ProtoReflect() protoreflect.Message
type NullValue ¶
type NullValue struct { // value and valid are ignored - they are always treated as false Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*NullValue) Descriptor
deprecated
func (*NullValue) ProtoMessage ¶
func (*NullValue) ProtoMessage()
func (*NullValue) ProtoReflect ¶
func (x *NullValue) ProtoReflect() protoreflect.Message
type NumericValue ¶
type NumericValue struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*NumericValue) Descriptor
deprecated
func (*NumericValue) Descriptor() ([]byte, []int)
Deprecated: Use NumericValue.ProtoReflect.Descriptor instead.
func (*NumericValue) GetValid ¶
func (x *NumericValue) GetValid() bool
func (*NumericValue) GetValue ¶
func (x *NumericValue) GetValue() float64
func (*NumericValue) ProtoMessage ¶
func (*NumericValue) ProtoMessage()
func (*NumericValue) ProtoReflect ¶
func (x *NumericValue) ProtoReflect() protoreflect.Message
func (*NumericValue) Reset ¶
func (x *NumericValue) Reset()
func (*NumericValue) String ¶
func (x *NumericValue) String() string
type QueryRequest ¶
type QueryRequest struct { Sql string `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"` Parameters []*Value `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"` // contains filtered or unexported fields }
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetParameters ¶
func (x *QueryRequest) GetParameters() []*Value
func (*QueryRequest) GetSql ¶
func (x *QueryRequest) GetSql() string
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
type QueryResponse ¶
type QueryResponse struct { // column types Columns []*Column `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` // returned values Rows []*ListValue `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"` // contains filtered or unexported fields }
func (*QueryResponse) Descriptor
deprecated
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetColumns ¶
func (x *QueryResponse) GetColumns() []*Column
func (*QueryResponse) GetRows ¶
func (x *QueryResponse) GetRows() []*ListValue
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶
func (x *QueryResponse) String() string
type RealValue ¶
type RealValue struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*RealValue) Descriptor
deprecated
func (*RealValue) ProtoMessage ¶
func (*RealValue) ProtoMessage()
func (*RealValue) ProtoReflect ¶
func (x *RealValue) ProtoReflect() protoreflect.Message
type TextValue ¶
type TextValue struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*TextValue) Descriptor
deprecated
func (*TextValue) ProtoMessage ¶
func (*TextValue) ProtoMessage()
func (*TextValue) ProtoReflect ¶
func (x *TextValue) ProtoReflect() protoreflect.Message
type TimeValue ¶
type TimeValue struct { Value *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` // contains filtered or unexported fields }
func (*TimeValue) Descriptor
deprecated
func (*TimeValue) GetValue ¶
func (x *TimeValue) GetValue() *timestamppb.Timestamp
func (*TimeValue) ProtoMessage ¶
func (*TimeValue) ProtoMessage()
func (*TimeValue) ProtoReflect ¶
func (x *TimeValue) ProtoReflect() protoreflect.Message
type TwirpServer ¶
type TwirpServer interface { http.Handler // ServiceDescriptor returns gzipped bytes describing the .proto file that // this service was generated from. Once unzipped, the bytes can be // unmarshalled as a // google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto. // // The returned integer is the index of this particular service within that // FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a // low-level field, expected to be used for reflection. ServiceDescriptor() ([]byte, int) // ProtocGenTwirpVersion is the semantic version string of the version of // twirp used to generate this file. ProtocGenTwirpVersion() string // PathPrefix returns the HTTP URL path prefix for all methods handled by this // service. This can be used with an HTTP mux to route Twirp requests. // The path prefix is in the form: "/<prefix>/<package>.<Service>/" // that is, everything in a Twirp route except for the <Method> at the end. PathPrefix() string }
TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.
func NewDatabaseServiceServer ¶
func NewDatabaseServiceServer(svc DatabaseService, opts ...interface{}) TwirpServer
NewDatabaseServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).
type Type ¶
type Type struct { // code is the sqlite type Code TypeCode `protobuf:"varint,1,opt,name=code,proto3,enum=sqlite.rpc.v0.TypeCode" json:"code,omitempty"` // contains filtered or unexported fields }
`Type` indicates the type of a sqlite value.
func (*Type) Descriptor
deprecated
func (*Type) ProtoMessage ¶
func (*Type) ProtoMessage()
func (*Type) ProtoReflect ¶
func (x *Type) ProtoReflect() protoreflect.Message
type TypeCode ¶
type TypeCode int32
`TypeCode` indicates the type of a sqlite value.
const ( TypeCode_TYPE_CODE_UNSPECIFIED TypeCode = 0 TypeCode_TYPE_CODE_INTEGER TypeCode = 1 TypeCode_TYPE_CODE_TEXT TypeCode = 2 TypeCode_TYPE_CODE_BLOB TypeCode = 3 TypeCode_TYPE_CODE_REAL TypeCode = 4 TypeCode_TYPE_CODE_NUMERIC TypeCode = 5 TypeCode_TYPE_CODE_BOOL TypeCode = 6 TypeCode_TYPE_CODE_TIME TypeCode = 7 TypeCode_TYPE_CODE_NULL TypeCode = 8 )
func (TypeCode) Descriptor ¶
func (TypeCode) Descriptor() protoreflect.EnumDescriptor
func (TypeCode) EnumDescriptor
deprecated
func (TypeCode) Number ¶
func (x TypeCode) Number() protoreflect.EnumNumber
func (TypeCode) Type ¶
func (TypeCode) Type() protoreflect.EnumType
type Value ¶
type Value struct { // Types that are assignable to Kind: // *Value_IntegerValue // *Value_TextValue // *Value_BlobValue // *Value_RealValue // *Value_NumericValue // *Value_BoolValue // *Value_TimeValue // *Value_NullValue Kind isValue_Kind `protobuf_oneof:"kind"` // contains filtered or unexported fields }
`Value` indicates the value of a parameter or returned column.
func (*Value) Descriptor
deprecated
func (*Value) GetBlobValue ¶
func (*Value) GetBoolValue ¶
func (*Value) GetIntegerValue ¶
func (x *Value) GetIntegerValue() *IntergerValue
func (*Value) GetNullValue ¶
func (*Value) GetNumericValue ¶
func (x *Value) GetNumericValue() *NumericValue
func (*Value) GetRealValue ¶
func (*Value) GetTextValue ¶
func (*Value) GetTimeValue ¶
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
type Value_BlobValue ¶
type Value_BlobValue struct {
BlobValue *BlobValue `protobuf:"bytes,3,opt,name=blob_value,json=blobValue,proto3,oneof"`
}
type Value_BoolValue ¶
type Value_BoolValue struct {
BoolValue *BoolValue `protobuf:"bytes,6,opt,name=bool_value,json=boolValue,proto3,oneof"`
}
type Value_IntegerValue ¶
type Value_IntegerValue struct {
IntegerValue *IntergerValue `protobuf:"bytes,1,opt,name=integer_value,json=integerValue,proto3,oneof"`
}
type Value_NullValue ¶
type Value_NullValue struct {
NullValue *NullValue `protobuf:"bytes,8,opt,name=null_value,json=nullValue,proto3,oneof"`
}
type Value_NumericValue ¶
type Value_NumericValue struct {
NumericValue *NumericValue `protobuf:"bytes,5,opt,name=numeric_value,json=numericValue,proto3,oneof"`
}
type Value_RealValue ¶
type Value_RealValue struct {
RealValue *RealValue `protobuf:"bytes,4,opt,name=real_value,json=realValue,proto3,oneof"`
}
type Value_TextValue ¶
type Value_TextValue struct {
TextValue *TextValue `protobuf:"bytes,2,opt,name=text_value,json=textValue,proto3,oneof"`
}
type Value_TimeValue ¶
type Value_TimeValue struct {
TimeValue *TimeValue `protobuf:"bytes,7,opt,name=time_value,json=timeValue,proto3,oneof"`
}