admin

package
v0.0.0-...-29e199f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	entities.StandardResourceMeta
	// InternalResourceID uniquely identifies an Admin by a single ID.
	entities.InternalResourceID
	// Description of this Admin.
	Description *string
	// Roles of this Admin for the RBAC.
	Roles []string
}

Admin defines the administrator user in the application.

type AdminCollection

type AdminCollection struct {
	// Items Admin in collection
	Items []Admin
	// StandardCollectionPage is the page data of the collection
	entities.StandardCollectionPage
}

AdminCollection defines a collection of Admin resources.

type AdminEditable

type AdminEditable struct {
	entities.StandardResourceMeta
	// Description of this Admin.
	Description *string
}

AdminEditable defines the editable fields of the Admin.

type AdminFilters

type AdminFilters interface {
	// OrderByCreationDate orders Admin in storage by creation date
	OrderByCreationDate(orderDirection persistence.OrderDirection) AdminFilters
	// OrderByLastUpdateDate orders Admin in storage by last update date
	OrderByLastUpdateDate(orderDirection persistence.OrderDirection) AdminFilters
	// Paged limits the maximum amount of items to limit parameter and starts the list in offset parameter
	Paged(limit int, offset int) AdminFilters
}

AdminFilters defines filter options for retrieving Admins from Storage.

type AdminStorage

type AdminStorage interface {
	// Add an Admin in AdminStorage.
	Add(ctx context.Context, data Admin) (*Admin, error)
	// Get an Admin from AdminStorage.
	Get(ctx context.Context, id entities.StandardID) (*Admin, error)
	// Edit and Admin from AdminStorage.
	Edit(ctx context.Context, data Admin) (*Admin, error)
	// Remove an Admin from AdminStorage.
	Remove(ctx context.Context, id entities.StandardID) (*Admin, error)
	// All Admins in AdminStorage.
	All(ctx context.Context, filters AdminFilters) (*AdminCollection, error)

	// Filter create an AdminFilters instance.
	Filter() AdminFilters
}

AdminStorage defines the functionality to interact with Admin in Storage.

type AdminUseCase

type AdminUseCase interface {
	// CreateAdmin creates an Admin in storage and returns an error if it fails
	CreateAdmin(ctx context.Context, creation CreateAdminInput) (*CreateAdminOutput, error)
	// ListAdmins lists Admin in storage and returns an error if it fails
	ListAdmins(ctx context.Context, listOptions ListAdminsInput) (*ListAdminsOutput, error)
	// GetAdmin gets an Admin in storage and returns an error if it fails
	GetAdmin(ctx context.Context, input GetAdminInput) (*GetAdminOutput, error)
	// EditAdmin edits an Admin in storage and returns an error if it fails
	EditAdmin(ctx context.Context, update EditAdminInput) (*EditAdminOutput, error)
	// DeleteAdmin deletes an Admin in storage and returns an error if it fails
	DeleteAdmin(ctx context.Context, input DeleteAdminInput) (*DeleteAdminOutput, error)
}

AdminUseCase defines the management of Admin in adminStorage.

type CreateAdminInput

type CreateAdminInput struct {
	// StandardID defines the identifier of the Admin resource.
	entities.StandardID
	// Description of this Admin.
	Description *string
}

CreateAdminInput configures the creation of an Admin

type CreateAdminOutput

type CreateAdminOutput struct {
	Admin
}

CreateAdminOutput output from Admin users creation.

type DefaultUseCase

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

DefaultUseCase implementation of AdminUseCase.

func ProvideDefaultUseCase

func ProvideDefaultUseCase(options DefaultUseCaseOptions) (*DefaultUseCase, error)

ProvideDefaultUseCase creates a new DefaultUseCase.

func (*DefaultUseCase) CreateAdmin

func (u *DefaultUseCase) CreateAdmin(ctx context.Context, input CreateAdminInput) (*CreateAdminOutput, error)

func (*DefaultUseCase) DeleteAdmin

func (u *DefaultUseCase) DeleteAdmin(ctx context.Context, input DeleteAdminInput) (*DeleteAdminOutput, error)

func (*DefaultUseCase) EditAdmin

func (u *DefaultUseCase) EditAdmin(ctx context.Context, input EditAdminInput) (*EditAdminOutput, error)

func (*DefaultUseCase) GetAdmin

func (u *DefaultUseCase) GetAdmin(ctx context.Context, input GetAdminInput) (*GetAdminOutput, error)

func (*DefaultUseCase) ListAdmins

func (u *DefaultUseCase) ListAdmins(ctx context.Context, input ListAdminsInput) (*ListAdminsOutput, error)

type DefaultUseCaseOptions

type DefaultUseCaseOptions struct {
	AdminStorage                AdminStorage
	RoleUseCase                 role.RoleUseCase
	ReferentialIntegrityUseCase referentialintegrity.ReferentialIntegrityUseCase
}

DefaultUseCaseOptions options to create a new DefaultUseCase.

type DeleteAdminInput

type DeleteAdminInput struct {
	// StandardID defines the identifier of the Admin resource.
	entities.StandardID
}

DeleteAdminInput identifies the Admin resource to be removed.

type DeleteAdminOutput

type DeleteAdminOutput struct {
	Admin
}

DeleteAdminOutput the deleted Admin resource.

type EditAdminInput

type EditAdminInput struct {
	AdminEditable
}

EditAdminInput configures the update of an Admin.

type EditAdminOutput

type EditAdminOutput struct {
	Admin
}

EditAdminOutput the edited Admin resource.

type GetAdminInput

type GetAdminInput struct {
	// StandardID defines the identifier of the Admin resource.
	entities.StandardID
}

GetAdminInput input to get a specific Admin.

type GetAdminOutput

type GetAdminOutput struct {
	Admin
}

GetAdminOutput the requested Admin resource.

type ListAdminsInput

type ListAdminsInput struct {
	// PageLimit maximum amount of Admin in list output.
	PageLimit int `valid:"natural"`
	// PageOffset amount of Admin elapsed in list output.
	PageOffset int `valid:"natural"`
	// OrderBy whether to order by last update date.
	OrderBy string
	// OrderDirection the direction in which the list will be ordered base on the attribute selected in OrderBy.
	OrderDirection string
}

ListAdminsInput defines all possible options to list Admin resources.

type ListAdminsOutput

type ListAdminsOutput struct {
	AdminCollection
}

ListAdminsOutput collection of Admin resources.

Jump to

Keyboard shortcuts

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