protobase

package module
v0.0.0-...-02ef5dd Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

README

protobase

Protobuf based generators for the development of Lambda services

resources

rationale

  • We use protobuf as a source of truth instead of CloudFormation since it supports more types for indexes instead of just B,S and N.
    • Also it support safe schema updates if all queries are function of the field numbers

backlog

  • figure out if we need -I=$GOPATH for users, if so can we ship it next to the binary?

  • Figure out a more distinctive name than 'protobase'

    • Make it so it is easy to line out a multiline query with just spaces
  • Make a mini parser to replace the $t variable in PartiQL statements

  • Would be nice if the method option 'op' could be an enum (check the optimize_for option)

  • SHOULD error when multiple gsi.pk options refer to the same index

Documentation

Overview

Package protobase provide protobuf options for gohandle service development

Index

Constants

This section is empty.

Variables

View Source
var (
	// optional bool pk = 88000;
	E_Pk = &file_ddb_proto_extTypes[1] // mark a field as the parition key
	// optional bool sk = 88001;
	E_Sk = &file_ddb_proto_extTypes[2] // mark a field as the sort key of a table
	// optional ddb.GsiOptions gsi = 88002;
	E_Gsi = &file_ddb_proto_extTypes[3]
	// optional ddb.LsiOptions lsi = 88003;
	E_Lsi = &file_ddb_proto_extTypes[4]
	// optional bool keys = 88004;
	E_Keys = &file_ddb_proto_extTypes[5]
	// optional bool item = 88006;
	E_Item = &file_ddb_proto_extTypes[6]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional ddb.OpOptions op = 88100;
	E_Op = &file_ddb_proto_extTypes[0]
)

Extension fields to descriptorpb.MessageOptions.

Functions

This section is empty.

Types

type FieldOpOptions

type FieldOpOptions struct {
	Item bool `protobuf:"varint,1,opt,name=item,proto3" json:"item,omitempty"`
	Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"`
	// contains filtered or unexported fields
}

func (*FieldOpOptions) Descriptor deprecated

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

Deprecated: Use FieldOpOptions.ProtoReflect.Descriptor instead.

func (*FieldOpOptions) GetItem

func (x *FieldOpOptions) GetItem() bool

func (*FieldOpOptions) GetKeys

func (x *FieldOpOptions) GetKeys() bool

func (*FieldOpOptions) ProtoMessage

func (*FieldOpOptions) ProtoMessage()

func (*FieldOpOptions) ProtoReflect

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

func (*FieldOpOptions) Reset

func (x *FieldOpOptions) Reset()

func (*FieldOpOptions) String

func (x *FieldOpOptions) String() string

type GsiOptions

type GsiOptions struct {
	Pk string `protobuf:"bytes,1,opt,name=pk,proto3" json:"pk,omitempty"` // mark the field as the partition key in the GSI with the provided name
	Sk string `protobuf:"bytes,2,opt,name=sk,proto3" json:"sk,omitempty"` // mark the field as the sort key in the GSI with the provided name
	// contains filtered or unexported fields
}

func (*GsiOptions) Descriptor deprecated

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

Deprecated: Use GsiOptions.ProtoReflect.Descriptor instead.

func (*GsiOptions) GetPk

func (x *GsiOptions) GetPk() string

func (*GsiOptions) GetSk

func (x *GsiOptions) GetSk() string

func (*GsiOptions) ProtoMessage

func (*GsiOptions) ProtoMessage()

func (*GsiOptions) ProtoReflect

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

func (*GsiOptions) Reset

func (x *GsiOptions) Reset()

func (*GsiOptions) String

func (x *GsiOptions) String() string

type LsiOptions

type LsiOptions struct {
	Sk string `protobuf:"bytes,1,opt,name=sk,proto3" json:"sk,omitempty"` // mark a field as the sort key in a LSI with the provided name
	// contains filtered or unexported fields
}

func (*LsiOptions) Descriptor deprecated

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

Deprecated: Use LsiOptions.ProtoReflect.Descriptor instead.

func (*LsiOptions) GetSk

func (x *LsiOptions) GetSk() string

func (*LsiOptions) ProtoMessage

func (*LsiOptions) ProtoMessage()

func (*LsiOptions) ProtoReflect

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

func (*LsiOptions) Reset

func (x *LsiOptions) Reset()

func (*LsiOptions) String

func (x *LsiOptions) String() string

type OpOptions

type OpOptions struct {

	// query marks the operation as a Query operation and configures the key condition
	//
	// Types that are assignable to Op:
	//	*OpOptions_Query
	//	*OpOptions_Put
	//	*OpOptions_Update
	Op isOpOptions_Op `protobuf_oneof:"op"`
	// condition adds a condition expression
	Condition string `protobuf:"bytes,9,opt,name=condition,proto3" json:"condition,omitempty"`
	// idx configures the LSI or GSI index on which to perform the operation
	Idx string `protobuf:"bytes,10,opt,name=idx,proto3" json:"idx,omitempty"`
	// contains filtered or unexported fields
}

func (*OpOptions) Descriptor deprecated

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

Deprecated: Use OpOptions.ProtoReflect.Descriptor instead.

func (*OpOptions) GetCondition

func (x *OpOptions) GetCondition() string

func (*OpOptions) GetIdx

func (x *OpOptions) GetIdx() string

func (*OpOptions) GetOp

func (m *OpOptions) GetOp() isOpOptions_Op

func (*OpOptions) GetPut

func (x *OpOptions) GetPut() bool

func (*OpOptions) GetQuery

func (x *OpOptions) GetQuery() string

func (*OpOptions) GetUpdate

func (x *OpOptions) GetUpdate() string

func (*OpOptions) ProtoMessage

func (*OpOptions) ProtoMessage()

func (*OpOptions) ProtoReflect

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

func (*OpOptions) Reset

func (x *OpOptions) Reset()

func (*OpOptions) String

func (x *OpOptions) String() string

type OpOptions_Put

type OpOptions_Put struct {
	Put bool `protobuf:"varint,2,opt,name=put,proto3,oneof"`
}

type OpOptions_Query

type OpOptions_Query struct {
	Query string `protobuf:"bytes,1,opt,name=query,proto3,oneof"`
}

type OpOptions_Update

type OpOptions_Update struct {
	Update string `protobuf:"bytes,3,opt,name=update,proto3,oneof"`
}

Directories

Path Synopsis
cmd
examples module
example1
Code generated by protoc-gen-dynamo.
Code generated by protoc-gen-dynamo.

Jump to

Keyboard shortcuts

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