entryapp

package
v0.0.0-...-f69d383 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package entryapp maintains the app layer api for the entry domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(app *web.App, cfg Config)

Routes adds specific routes for this group.

Types

type Bundle

type Bundle struct {
	ID          string `json:"id"`
	UserID      string `json:"userID"`
	Type        string `json:"type"`
	Metadata    string `json:"metadata"`
	DateCreated string `json:"dateCreated"`
	DateUpdated string `json:"dateUpdated"`
}

Bundle represents information about an individual bundle.

type Config

type Config struct {
	Log        *logger.Logger
	DB         *sqlx.DB
	EntryBus   *entrybus.Business
	BundleBus  *bundlebus.Business
	KeyBus     *keybus.Business
	AuthClient *authclient.Client
}

Config contains all the mandatory systems required by handlers.

type DeleteEntry

type DeleteEntry struct {
	Metadata string `json:"metadata" validate:"required"`
}

DeleteEntry defines the data needed to update a bundle metadata after deleting a password entry.

func (*DeleteEntry) Decode

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

Decode implements the decoder interface.

func (DeleteEntry) Validate

func (app DeleteEntry) Validate() error

Validate checks the data in the model is considered clean.

type Entry

type Entry struct {
	ID          string `json:"id"`
	UserID      string `json:"userID"`
	BundleID    string `json:"bundleID"`
	Data        string `json:"data"`
	DateCreated string `json:"dateCreated"`
	DateUpdated string `json:"dateUpdated"`
}

Entry represents information about an individual entry.

func (Entry) Encode

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

Encode implements the encoder interface.

type EntryTx

type EntryTx struct {
	Entry  Entry  `json:"entry"`
	Bundle Bundle `json:"bundle"`
}

Entry represents information about an individual entry.

func (EntryTx) Encode

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

Encode implements the encoder interface.

type NewEntryTX

type NewEntryTX struct {
	Data     string `json:"data" validate:"required"`
	Metadata string `json:"metadatadata" validate:"required"`
}

NewEntryTX defines the data needed to add a new entry.

func (*NewEntryTX) Decode

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

Decode implements the decoder interface.

func (NewEntryTX) Validate

func (app NewEntryTX) Validate() error

Validate checks the data in the model is considered clean.

type UpdateEntry

type UpdateEntry struct {
	Data     string `json:"data" validate:"required"`
	Metadata string `json:"metadata" validate:"required"`
}

UpdateEntry defines the data needed to update a entry.

func (*UpdateEntry) Decode

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

Decode implements the decoder interface.

func (UpdateEntry) Validate

func (app UpdateEntry) 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