freightdb

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDescriptor

type ColumnDescriptor interface {
	ColumnID() spansql.ID
	ColumnName() string
	ColumnType() spansql.Type
	NotNull() bool
	AllowCommitTimestamp() bool
}

type DatabaseDescriptor

type DatabaseDescriptor interface {
	Shippers() ShippersTableDescriptor
	Sites() SitesTableDescriptor
	Shipments() ShipmentsTableDescriptor
	LineItems() LineItemsTableDescriptor
}

func Descriptor

func Descriptor() DatabaseDescriptor

type LineItemsKey

type LineItemsKey struct {
	ShipperId  string
	ShipmentId string
	LineNumber int64
}

func (LineItemsKey) BoolExpr

func (k LineItemsKey) BoolExpr() spansql.BoolExpr

func (LineItemsKey) Delete

func (k LineItemsKey) Delete() *spanner.Mutation

func (LineItemsKey) Order

func (LineItemsKey) Order() []spansql.Order

func (LineItemsKey) QualifiedBoolExpr

func (k LineItemsKey) QualifiedBoolExpr(prefix spansql.PathExp) spansql.BoolExpr

func (LineItemsKey) SpannerKey

func (k LineItemsKey) SpannerKey() spanner.Key

func (LineItemsKey) SpannerKeySet

func (k LineItemsKey) SpannerKeySet() spanner.KeySet

type LineItemsReadTransaction

type LineItemsReadTransaction struct {
	Tx SpannerReadTransaction
}

func LineItems

func (LineItemsReadTransaction) BatchGet

func (LineItemsReadTransaction) Get

func (LineItemsReadTransaction) List

func (LineItemsReadTransaction) Read

type LineItemsRow

type LineItemsRow struct {
	ShipperId  string              `spanner:"shipper_id"`
	ShipmentId string              `spanner:"shipment_id"`
	LineNumber int64               `spanner:"line_number"`
	Title      spanner.NullString  `spanner:"title"`
	Quantity   spanner.NullFloat64 `spanner:"quantity"`
	WeightKg   spanner.NullFloat64 `spanner:"weight_kg"`
	VolumeM3   spanner.NullFloat64 `spanner:"volume_m3"`
}

func (*LineItemsRow) ColumnExprs

func (*LineItemsRow) ColumnExprs() []spansql.Expr

func (*LineItemsRow) ColumnIDs

func (*LineItemsRow) ColumnIDs() []spansql.ID

func (*LineItemsRow) ColumnNames

func (*LineItemsRow) ColumnNames() []string

func (*LineItemsRow) Insert

func (r *LineItemsRow) Insert() *spanner.Mutation

func (*LineItemsRow) InsertColumns

func (r *LineItemsRow) InsertColumns(columns []string) *spanner.Mutation

func (*LineItemsRow) InsertOrUpdate

func (r *LineItemsRow) InsertOrUpdate() *spanner.Mutation

func (*LineItemsRow) InsertOrUpdateColumns

func (r *LineItemsRow) InsertOrUpdateColumns(columns []string) *spanner.Mutation

func (*LineItemsRow) Key

func (r *LineItemsRow) Key() LineItemsKey

func (*LineItemsRow) Mutation

func (r *LineItemsRow) Mutation() (string, []string, []interface{})

func (*LineItemsRow) MutationForColumns

func (r *LineItemsRow) MutationForColumns(columns []string) (string, []string, []interface{})

func (*LineItemsRow) UnmarshalSpannerRow

func (r *LineItemsRow) UnmarshalSpannerRow(row *spanner.Row) error

func (*LineItemsRow) Update

func (r *LineItemsRow) Update() *spanner.Mutation

func (*LineItemsRow) UpdateColumns

func (r *LineItemsRow) UpdateColumns(columns []string) *spanner.Mutation

func (*LineItemsRow) Validate

func (r *LineItemsRow) Validate() error

type LineItemsRowIterator

type LineItemsRowIterator struct {
	*spanner.RowIterator
}

func (*LineItemsRowIterator) Do

func (i *LineItemsRowIterator) Do(f func(row *LineItemsRow) error) error

func (*LineItemsRowIterator) Next

func (i *LineItemsRowIterator) Next() (*LineItemsRow, error)

type LineItemsTableDescriptor

type LineItemsTableDescriptor interface {
	TableName() string
	TableID() spansql.ID
	ColumnNames() []string
	ColumnIDs() []spansql.ID
	ShipperId() ColumnDescriptor
	ShipmentId() ColumnDescriptor
	LineNumber() ColumnDescriptor
	Title() ColumnDescriptor
	Quantity() ColumnDescriptor
	WeightKg() ColumnDescriptor
	VolumeM3() ColumnDescriptor
}

type ListQuery

type ListQuery struct {
	Where  spansql.BoolExpr
	Order  []spansql.Order
	Limit  int32
	Offset int64
}

type ShipmentsAndLineItemsReadTransaction

type ShipmentsAndLineItemsReadTransaction struct {
	Tx SpannerReadTransaction
}

func ShipmentsAndLineItems

func (ShipmentsAndLineItemsReadTransaction) BatchGet

func (ShipmentsAndLineItemsReadTransaction) Get

func (ShipmentsAndLineItemsReadTransaction) List

type ShipmentsAndLineItemsRow

type ShipmentsAndLineItemsRow struct {
	ShipperId            string             `spanner:"shipper_id"`
	ShipmentId           string             `spanner:"shipment_id"`
	CreateTime           time.Time          `spanner:"create_time"`
	UpdateTime           time.Time          `spanner:"update_time"`
	DeleteTime           spanner.NullTime   `spanner:"delete_time"`
	OriginSiteId         spanner.NullString `spanner:"origin_site_id"`
	DestinationSiteId    spanner.NullString `spanner:"destination_site_id"`
	PickupEarliestTime   spanner.NullTime   `spanner:"pickup_earliest_time"`
	PickupLatestTime     spanner.NullTime   `spanner:"pickup_latest_time"`
	DeliveryEarliestTime spanner.NullTime   `spanner:"delivery_earliest_time"`
	DeliveryLatestTime   spanner.NullTime   `spanner:"delivery_latest_time"`
	LineItems            []*LineItemsRow    `spanner:"line_items"`
}

func (ShipmentsAndLineItemsRow) Insert

func (*ShipmentsAndLineItemsRow) Key

func (ShipmentsAndLineItemsRow) ShipmentsRow

func (r ShipmentsAndLineItemsRow) ShipmentsRow() *ShipmentsRow

func (*ShipmentsAndLineItemsRow) UnmarshalSpannerRow

func (r *ShipmentsAndLineItemsRow) UnmarshalSpannerRow(row *spanner.Row) error

func (ShipmentsAndLineItemsRow) Update

type ShipmentsAndLineItemsRowIterator

type ShipmentsAndLineItemsRowIterator struct {
	*spanner.RowIterator
}

func (*ShipmentsAndLineItemsRowIterator) Do

func (*ShipmentsAndLineItemsRowIterator) Next

type ShipmentsKey

type ShipmentsKey struct {
	ShipperId  string
	ShipmentId string
}

func (ShipmentsKey) BoolExpr

func (k ShipmentsKey) BoolExpr() spansql.BoolExpr

func (ShipmentsKey) Delete

func (k ShipmentsKey) Delete() *spanner.Mutation

func (ShipmentsKey) Order

func (ShipmentsKey) Order() []spansql.Order

func (ShipmentsKey) QualifiedBoolExpr

func (k ShipmentsKey) QualifiedBoolExpr(prefix spansql.PathExp) spansql.BoolExpr

func (ShipmentsKey) SpannerKey

func (k ShipmentsKey) SpannerKey() spanner.Key

func (ShipmentsKey) SpannerKeySet

func (k ShipmentsKey) SpannerKeySet() spanner.KeySet

type ShipmentsReadTransaction

type ShipmentsReadTransaction struct {
	Tx SpannerReadTransaction
}

func Shipments

func (ShipmentsReadTransaction) BatchGet

func (ShipmentsReadTransaction) Get

func (ShipmentsReadTransaction) List

func (ShipmentsReadTransaction) Read

type ShipmentsRow

type ShipmentsRow struct {
	ShipperId            string             `spanner:"shipper_id"`
	ShipmentId           string             `spanner:"shipment_id"`
	CreateTime           time.Time          `spanner:"create_time"`
	UpdateTime           time.Time          `spanner:"update_time"`
	DeleteTime           spanner.NullTime   `spanner:"delete_time"`
	OriginSiteId         spanner.NullString `spanner:"origin_site_id"`
	DestinationSiteId    spanner.NullString `spanner:"destination_site_id"`
	PickupEarliestTime   spanner.NullTime   `spanner:"pickup_earliest_time"`
	PickupLatestTime     spanner.NullTime   `spanner:"pickup_latest_time"`
	DeliveryEarliestTime spanner.NullTime   `spanner:"delivery_earliest_time"`
	DeliveryLatestTime   spanner.NullTime   `spanner:"delivery_latest_time"`
}

func (*ShipmentsRow) ColumnExprs

func (*ShipmentsRow) ColumnExprs() []spansql.Expr

func (*ShipmentsRow) ColumnIDs

func (*ShipmentsRow) ColumnIDs() []spansql.ID

func (*ShipmentsRow) ColumnNames

func (*ShipmentsRow) ColumnNames() []string

func (*ShipmentsRow) Insert

func (r *ShipmentsRow) Insert() *spanner.Mutation

func (*ShipmentsRow) InsertColumns

func (r *ShipmentsRow) InsertColumns(columns []string) *spanner.Mutation

func (*ShipmentsRow) InsertOrUpdate

func (r *ShipmentsRow) InsertOrUpdate() *spanner.Mutation

func (*ShipmentsRow) InsertOrUpdateColumns

func (r *ShipmentsRow) InsertOrUpdateColumns(columns []string) *spanner.Mutation

func (*ShipmentsRow) Key

func (r *ShipmentsRow) Key() ShipmentsKey

func (*ShipmentsRow) Mutation

func (r *ShipmentsRow) Mutation() (string, []string, []interface{})

func (*ShipmentsRow) MutationForColumns

func (r *ShipmentsRow) MutationForColumns(columns []string) (string, []string, []interface{})

func (*ShipmentsRow) UnmarshalSpannerRow

func (r *ShipmentsRow) UnmarshalSpannerRow(row *spanner.Row) error

func (*ShipmentsRow) Update

func (r *ShipmentsRow) Update() *spanner.Mutation

func (*ShipmentsRow) UpdateColumns

func (r *ShipmentsRow) UpdateColumns(columns []string) *spanner.Mutation

func (*ShipmentsRow) Validate

func (r *ShipmentsRow) Validate() error

type ShipmentsRowIterator

type ShipmentsRowIterator struct {
	*spanner.RowIterator
}

func (*ShipmentsRowIterator) Do

func (i *ShipmentsRowIterator) Do(f func(row *ShipmentsRow) error) error

func (*ShipmentsRowIterator) Next

func (i *ShipmentsRowIterator) Next() (*ShipmentsRow, error)

type ShipmentsTableDescriptor

type ShipmentsTableDescriptor interface {
	TableName() string
	TableID() spansql.ID
	ColumnNames() []string
	ColumnIDs() []spansql.ID
	ShipperId() ColumnDescriptor
	ShipmentId() ColumnDescriptor
	CreateTime() ColumnDescriptor
	UpdateTime() ColumnDescriptor
	DeleteTime() ColumnDescriptor
	OriginSiteId() ColumnDescriptor
	DestinationSiteId() ColumnDescriptor
	PickupEarliestTime() ColumnDescriptor
	PickupLatestTime() ColumnDescriptor
	DeliveryEarliestTime() ColumnDescriptor
	DeliveryLatestTime() ColumnDescriptor
}

type ShippersKey

type ShippersKey struct {
	ShipperId string
}

func (ShippersKey) BoolExpr

func (k ShippersKey) BoolExpr() spansql.BoolExpr

func (ShippersKey) Delete

func (k ShippersKey) Delete() *spanner.Mutation

func (ShippersKey) Order

func (ShippersKey) Order() []spansql.Order

func (ShippersKey) QualifiedBoolExpr

func (k ShippersKey) QualifiedBoolExpr(prefix spansql.PathExp) spansql.BoolExpr

func (ShippersKey) SpannerKey

func (k ShippersKey) SpannerKey() spanner.Key

func (ShippersKey) SpannerKeySet

func (k ShippersKey) SpannerKeySet() spanner.KeySet

type ShippersReadTransaction

type ShippersReadTransaction struct {
	Tx SpannerReadTransaction
}

func Shippers

func (ShippersReadTransaction) BatchGet

func (t ShippersReadTransaction) BatchGet(
	ctx context.Context,
	keys []ShippersKey,
) (map[ShippersKey]*ShippersRow, error)

func (ShippersReadTransaction) Get

func (ShippersReadTransaction) List

func (ShippersReadTransaction) Read

type ShippersRow

type ShippersRow struct {
	ShipperId  string           `spanner:"shipper_id"`
	CreateTime time.Time        `spanner:"create_time"`
	UpdateTime time.Time        `spanner:"update_time"`
	DeleteTime spanner.NullTime `spanner:"delete_time"`
}

func (*ShippersRow) ColumnExprs

func (*ShippersRow) ColumnExprs() []spansql.Expr

func (*ShippersRow) ColumnIDs

func (*ShippersRow) ColumnIDs() []spansql.ID

func (*ShippersRow) ColumnNames

func (*ShippersRow) ColumnNames() []string

func (*ShippersRow) Insert

func (r *ShippersRow) Insert() *spanner.Mutation

func (*ShippersRow) InsertColumns

func (r *ShippersRow) InsertColumns(columns []string) *spanner.Mutation

func (*ShippersRow) InsertOrUpdate

func (r *ShippersRow) InsertOrUpdate() *spanner.Mutation

func (*ShippersRow) InsertOrUpdateColumns

func (r *ShippersRow) InsertOrUpdateColumns(columns []string) *spanner.Mutation

func (*ShippersRow) Key

func (r *ShippersRow) Key() ShippersKey

func (*ShippersRow) Mutation

func (r *ShippersRow) Mutation() (string, []string, []interface{})

func (*ShippersRow) MutationForColumns

func (r *ShippersRow) MutationForColumns(columns []string) (string, []string, []interface{})

func (*ShippersRow) UnmarshalSpannerRow

func (r *ShippersRow) UnmarshalSpannerRow(row *spanner.Row) error

func (*ShippersRow) Update

func (r *ShippersRow) Update() *spanner.Mutation

func (*ShippersRow) UpdateColumns

func (r *ShippersRow) UpdateColumns(columns []string) *spanner.Mutation

func (*ShippersRow) Validate

func (r *ShippersRow) Validate() error

type ShippersRowIterator

type ShippersRowIterator struct {
	*spanner.RowIterator
}

func (*ShippersRowIterator) Do

func (i *ShippersRowIterator) Do(f func(row *ShippersRow) error) error

func (*ShippersRowIterator) Next

func (i *ShippersRowIterator) Next() (*ShippersRow, error)

type ShippersTableDescriptor

type ShippersTableDescriptor interface {
	TableName() string
	TableID() spansql.ID
	ColumnNames() []string
	ColumnIDs() []spansql.ID
	ShipperId() ColumnDescriptor
	CreateTime() ColumnDescriptor
	UpdateTime() ColumnDescriptor
	DeleteTime() ColumnDescriptor
}

type SitesKey

type SitesKey struct {
	ShipperId string
	SiteId    string
}

func (SitesKey) BoolExpr

func (k SitesKey) BoolExpr() spansql.BoolExpr

func (SitesKey) Delete

func (k SitesKey) Delete() *spanner.Mutation

func (SitesKey) Order

func (SitesKey) Order() []spansql.Order

func (SitesKey) QualifiedBoolExpr

func (k SitesKey) QualifiedBoolExpr(prefix spansql.PathExp) spansql.BoolExpr

func (SitesKey) SpannerKey

func (k SitesKey) SpannerKey() spanner.Key

func (SitesKey) SpannerKeySet

func (k SitesKey) SpannerKeySet() spanner.KeySet

type SitesReadTransaction

type SitesReadTransaction struct {
	Tx SpannerReadTransaction
}

func Sites

func (SitesReadTransaction) BatchGet

func (t SitesReadTransaction) BatchGet(
	ctx context.Context,
	keys []SitesKey,
) (map[SitesKey]*SitesRow, error)

func (SitesReadTransaction) Get

func (t SitesReadTransaction) Get(
	ctx context.Context,
	key SitesKey,
) (*SitesRow, error)

func (SitesReadTransaction) List

func (SitesReadTransaction) Read

type SitesRow

type SitesRow struct {
	ShipperId   string              `spanner:"shipper_id"`
	SiteId      string              `spanner:"site_id"`
	CreateTime  time.Time           `spanner:"create_time"`
	UpdateTime  time.Time           `spanner:"update_time"`
	DeleteTime  spanner.NullTime    `spanner:"delete_time"`
	DisplayName spanner.NullString  `spanner:"display_name"`
	Latitude    spanner.NullFloat64 `spanner:"latitude"`
	Longitude   spanner.NullFloat64 `spanner:"longitude"`
}

func (*SitesRow) ColumnExprs

func (*SitesRow) ColumnExprs() []spansql.Expr

func (*SitesRow) ColumnIDs

func (*SitesRow) ColumnIDs() []spansql.ID

func (*SitesRow) ColumnNames

func (*SitesRow) ColumnNames() []string

func (*SitesRow) Insert

func (r *SitesRow) Insert() *spanner.Mutation

func (*SitesRow) InsertColumns

func (r *SitesRow) InsertColumns(columns []string) *spanner.Mutation

func (*SitesRow) InsertOrUpdate

func (r *SitesRow) InsertOrUpdate() *spanner.Mutation

func (*SitesRow) InsertOrUpdateColumns

func (r *SitesRow) InsertOrUpdateColumns(columns []string) *spanner.Mutation

func (*SitesRow) Key

func (r *SitesRow) Key() SitesKey

func (*SitesRow) Mutation

func (r *SitesRow) Mutation() (string, []string, []interface{})

func (*SitesRow) MutationForColumns

func (r *SitesRow) MutationForColumns(columns []string) (string, []string, []interface{})

func (*SitesRow) UnmarshalSpannerRow

func (r *SitesRow) UnmarshalSpannerRow(row *spanner.Row) error

func (*SitesRow) Update

func (r *SitesRow) Update() *spanner.Mutation

func (*SitesRow) UpdateColumns

func (r *SitesRow) UpdateColumns(columns []string) *spanner.Mutation

func (*SitesRow) Validate

func (r *SitesRow) Validate() error

type SitesRowIterator

type SitesRowIterator struct {
	*spanner.RowIterator
}

func (*SitesRowIterator) Do

func (i *SitesRowIterator) Do(f func(row *SitesRow) error) error

func (*SitesRowIterator) Next

func (i *SitesRowIterator) Next() (*SitesRow, error)

type SitesTableDescriptor

type SitesTableDescriptor interface {
	TableName() string
	TableID() spansql.ID
	ColumnNames() []string
	ColumnIDs() []spansql.ID
	ShipperId() ColumnDescriptor
	SiteId() ColumnDescriptor
	CreateTime() ColumnDescriptor
	UpdateTime() ColumnDescriptor
	DeleteTime() ColumnDescriptor
	DisplayName() ColumnDescriptor
	Latitude() ColumnDescriptor
	Longitude() ColumnDescriptor
}

type SpannerReadTransaction

type SpannerReadTransaction interface {
	Read(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator
	ReadRow(ctx context.Context, table string, key spanner.Key, columns []string) (*spanner.Row, error)
	Query(ctx context.Context, statement spanner.Statement) *spanner.RowIterator
}

Jump to

Keyboard shortcuts

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