Documentation
¶
Overview ¶
Package bundleapp maintains the app layer api for the bundle domain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 defines the data needed to add a new bundle.
type Config ¶
type Config struct {
Log *logger.Logger
DB *sqlx.DB
UserBus *userbus.Business
KeyBus *keybus.Business
BundleBus *bundlebus.Business
AuthClient *authclient.Client
}
Config contains all the mandatory systems required by handlers.
type Key ¶
type Key struct {
ID string `json:"id"`
UserID string `json:"userID"`
Data string `json:"data"`
DateCreated string `json:"dateCreated"`
DateUpdated string `json:"dateUpdated"`
}
Key represents an individual key.
type NewBundle ¶
type NewBundle struct {
Type string `json:"type" validate:"required"`
Metadata string `json:"metadata" validate:"required"`
}
NewBundle defines the data needed to add a new bundle.
type NewBundleTx ¶
type NewBundleTx struct {
Bundle NewBundle `json:"bundle" validate:"required"`
Key NewKey `json:"key" validate:"required"`
}
NewBundleTx represents an example of cross domain transaction at the application layer.
func (*NewBundleTx) Decode ¶
func (app *NewBundleTx) Decode(data []byte) error
Decode implements the decoder interface.
func (NewBundleTx) Validate ¶
func (app NewBundleTx) Validate() error
Validate checks the data in the model is considered clean.
type NewKey ¶
type NewKey struct {
Data string `json:"data" validate:"required"`
}
NewKey is what we require from clients when adding a Key.
type NewUser ¶
type NewUser struct {
Name string `json:"name" validate:"required"`
Email string `json:"email" validate:"required,email"`
Roles []string `json:"roles" validate:"required"`
Department string `json:"department"`
Password string `json:"password" validate:"required"`
PasswordConfirm string `json:"passwordConfirm" validate:"eqfield=Password"`
}
============================================================================= NewUser contains information needed to create a new user.
type UpdateBundle ¶
type UpdateBundle struct {
Type *string `json:"type"` // TODO may not want to allow updating bundle type 🤔
Metadata *string `json:"metadata"`
}
UpdateBundle defines the data needed to update a bundle.
func (*UpdateBundle) Decode ¶
func (app *UpdateBundle) Decode(data []byte) error
Decode implements the decoder interface.
func (UpdateBundle) Validate ¶
func (app UpdateBundle) Validate() error
Validate checks the data in the model is considered clean.