gorestapi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRStore

type GRStore interface {
	ThingGetByID(ctx context.Context, id string) (*Thing, error)
	ThingSave(ctx context.Context, thing *Thing) error
	ThingDeleteByID(ctx context.Context, id string) error
	ThingsFind(ctx context.Context, qp *queryp.QueryParameters) ([]*Thing, *int64, error)

	WidgetGetByID(ctx context.Context, id string) (*Widget, error)
	WidgetSave(ctx context.Context, thing *Widget) error
	WidgetDeleteByID(ctx context.Context, id string) error
	WidgetsFind(ctx context.Context, qp *queryp.QueryParameters) ([]*Widget, *int64, error)
}

GRStore is the persistent store of things

type Thing

type Thing struct {
	// ID (Auto-Generated)
	ID string `json:"id"`
	// Created Timestamp
	Created time.Time `json:"created,omitempty"`
	// Updated Timestamp
	Updated time.Time `json:"updated,omitempty"`
	// Name
	Name string `json:"name"`
	// Description
	Description string `json:"description"`
}

Thing

func (*Thing) String

func (t *Thing) String() string

String is the stringer method

type ThingExample

type ThingExample struct {
	// Name
	Name string `json:"name"`
	// Description
	Description string `json:"description"`
}

ThingExample

type Widget

type Widget struct {
	// ID (Auto-Generated)
	ID string `json:"id"`
	// Created Timestamp
	Created time.Time `json:"created,omitempty"`
	// Updated Timestamp
	Updated time.Time `json:"updated,omitempty"`
	// Name
	Name string `json:"name"`
	// Description
	Description string `json:"description"`
	// ThingID
	ThingID *string `json:"thing_id,omitempty" db:"thing_id"`

	// Loaded Structs
	Thing *Thing `json:"thing,omitempty" db:"thing"`
}

Widget swagger:model gorestapi_Widget

func (*Widget) String

func (w *Widget) String() string

String is the stringer method

func (*Widget) SyncDB

func (w *Widget) SyncDB()

SyncDB will fix Loaded Structs

type WidgetExample

type WidgetExample struct {
	// Name
	Name string `json:"name"`
	// Description
	Description string `json:"description"`
	// ThingID
	ThingID *string `json:"thing_id,omitempty" db:"thing_id"`
}

WidgetExample swagger:model gorestapi_WidgetExample

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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