galaxyapp

package
v0.0.0-...-da924b9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the galaxy domain.

func NewApp

func NewApp(galaxyBus *galaxybus.Business) *App

NewApp constructs a galaxy app API for use.

func NewAppWithAuth

func NewAppWithAuth(galaxyBus *galaxybus.Business) *App

NewAppWithAuth constructs a galaxy app API for use with auth support.

func (*App) Create

func (a *App) Create(ctx context.Context, app NewGalaxy) (Galaxy, error)

Create adds a new galaxy to the system.

func (*App) Delete

func (a *App) Delete(ctx context.Context, galaxyID string) error

Delete removes a galaxy from the system.

func (*App) Query

func (a *App) Query(ctx context.Context, qp QueryParams) (page.Document[Galaxy], error)

Query returns a list of galaxys with paging.

func (*App) QueryByID

func (a *App) QueryByID(ctx context.Context, galaxyID string) (Galaxy, error)

QueryByID returns a galaxy by its Ia.

func (*App) QueryByName

func (a *App) QueryByName(ctx context.Context, galaxyName string) (Galaxy, error)

QueryByName returns a galaxy by its Ia.

func (*App) Update

func (a *App) Update(ctx context.Context, galaxyID string, app UpdateGalaxy) (Galaxy, error)

Update updates an existing galaxy.

type Galaxy

type Galaxy struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	OwnerUserID string `json:"ownerUserID"`
	Enabled     bool   `json:"enabled"`
	DateCreated string `json:"dateCreated"`
	DateUpdated string `json:"dateUpdated"`
}

Galaxy represents information about an individual galaxy.

func (Galaxy) Encode

func (app Galaxy) Encode() ([]byte, string, error)

Encode implments the encoder interface.

type NewGalaxy

type NewGalaxy struct {
	Name        string `json:"name" validate:"required"`
	OwnerUserID string `json:"ownerUserID" validate:"required,uuid"`
}

NewGalaxy defines the data needed to add a new galaxy.

func (*NewGalaxy) Decode

func (app *NewGalaxy) Decode(data []byte) error

Decode implments the decoder interface.

func (NewGalaxy) Validate

func (app NewGalaxy) Validate() error

Validate checks the data in the model is considered clean.

type QueryParams

type QueryParams struct {
	Page        string
	Rows        string
	OrderBy     string
	ID          string
	Name        string
	DateCreated string
}

QueryParams represents the set of possible query strings.

type UpdateGalaxy

type UpdateGalaxy struct {
	Name        *string `json:"name"`
	OwnerUserID *string `json:"ownerUserID" validate:"omitempty,uuid"`
	Enabled     *bool   `json:"enabled"`
}

UpdateGalaxy defines the data needed to update a galaxy.

func (*UpdateGalaxy) Decode

func (app *UpdateGalaxy) Decode(data []byte) error

Decode implments the decoder interface.

func (UpdateGalaxy) Validate

func (app UpdateGalaxy) Validate() error

Validate checks the data in the model is considered clean.

Jump to

Keyboard shortcuts

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