badge

package
v0.0.0-...-d125d34 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	Create       `json:",inline"`
	ID           uint      `json:"id"`
	ResourceID   uint      `json:"resourceID"`
	ResourceType string    `json:"resourceType"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
}

func (*Badge) FromDAO

func (b *Badge) FromDAO(daoBadge *models.Badge)

type Controller

type Controller interface {
	CreateBadge(ctx context.Context, resourceType string, resourceID uint, badge *Create) (*Badge, error)
	UpdateBadge(ctx context.Context, id uint, badge *Update) (*Badge, error)
	UpdateBadgeByName(ctx context.Context, resourceType string,
		resourceID uint, name string, badge *Update) (*Badge, error)
	ListBadges(ctx context.Context, resourceType string, resourceID uint) ([]*Badge, error)
	GetBadge(ctx context.Context, id uint) (*Badge, error)
	GetBadgeByName(ctx context.Context, resourceType string, resourceID uint, name string) (*Badge, error)
	DeleteBadge(ctx context.Context, id uint) error
	DeleteBadgeByName(ctx context.Context, resourceType string, resourceID uint, name string) error
}

func NewController

func NewController(param *param.Param) Controller

type Create

type Create struct {
	SvgLink      string `json:"svgLink"`
	RedirectLink string `json:"redirectLink,omitempty"`
	Name         string `json:"name"`
}

type Update

type Update struct {
	SvgLink      *string `json:"svgLink"`
	RedirectLink *string `json:"redirectLink"`
}

Jump to

Keyboard shortcuts

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