demo

package
v0.15.10-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceName       = "Demo"
	ResourceNamePlural = "Demos"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Demo

type Demo struct {
	ID                 id.ID                   `json:"id"`
	Name               string                  `json:"name"`
	Type               DemoType                `json:"type"`
	Enabled            bool                    `json:"enabled"`
	Pokeshop           *PokeshopDemo           `json:"pokeshop,omitempty"`
	OpenTelemetryStore *OpenTelemetryStoreDemo `json:"opentelemetryStore,omitempty"`
}

func (Demo) GetID

func (d Demo) GetID() id.ID

func (Demo) HasID

func (d Demo) HasID() bool

func (Demo) Validate

func (d Demo) Validate() error

type DemoType

type DemoType string
const (
	DemoTypePokeshop           DemoType = "pokeshop"
	DemoTypeOpentelemetryStore DemoType = "otelstore"
)

type OpenTelemetryStoreDemo

type OpenTelemetryStoreDemo struct {
	FrontendEndpoint       string `json:"frontendEndpoint,omitempty"`
	ProductCatalogEndpoint string `json:"productCatalogEndpoint,omitempty"`
	CartEndpoint           string `json:"cartEndpoint,omitempty"`
	CheckoutEndpoint       string `json:"checkoutEndpoint,omitempty"`
}

type PokeshopDemo

type PokeshopDemo struct {
	HTTPEndpoint string `json:"httpEndpoint,omitempty"`
	GRPCEndpoint string `json:"grpcEndpoint,omitempty"`
	KafkaBroker  string `json:"kafkaBroker,omitempty"`
}

type Repository

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

func NewRepository

func NewRepository(db *sql.DB) *Repository

func (*Repository) Count

func (r *Repository) Count(ctx context.Context, query string) (int, error)

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, demo Demo) (Demo, error)

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, id id.ID) error

func (*Repository) Get

func (r *Repository) Get(ctx context.Context, id id.ID) (Demo, error)

func (*Repository) List

func (r *Repository) List(ctx context.Context, take, skip int, query, sortBy, sortDirection string) ([]Demo, error)

func (*Repository) Provision

func (r *Repository) Provision(ctx context.Context, demo Demo) error

func (*Repository) SetID

func (r *Repository) SetID(demo Demo, id id.ID) Demo

func (Repository) SortingFields

func (r Repository) SortingFields() []string

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, demo Demo) (Demo, error)

Jump to

Keyboard shortcuts

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