photo

package
v0.0.0-...-f34e32e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Megabyte = 20

Variables

View Source
var CreateScript string
View Source
var ErrInvalidParameter = errors.New("invalid paramater")
View Source
var ErrNoRecord = errors.New("no record found")
View Source
var FixtureScript string

Functions

func Crop

func Crop(src image.Image) image.Image

func Resize

func Resize(src image.Image) image.Image

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock ist eine Schnittstelle, die das aktuelle Datum und die aktuelle Uhrzeit bereitstellt.

type DownloadHandler

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

func (DownloadHandler) ServeData

func (h DownloadHandler) ServeData(r *http.Request) webx.Result

type FormHandler

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

Form liefert eine Ansicht für die Bearbeitung eines Photos

func (FormHandler) ServeData

func (h FormHandler) ServeData(fragment string, r *http.Request) webx.HandlerResult

type Module

type Module struct {
	Repository Repository
	EventBus   esx.EventBus
	Templates  fs.FS
}

func (*Module) Mount

func (m *Module) Mount(mux *http.ServeMux, prefix string, middleware ...webx.Middleware)

type PhotoData

type PhotoData struct {
	Id       int64
	PhotoUrl string
}

type Repository

type Repository interface {
	GetPhotoById(ctx context.Context, dingId int64) ([]byte, error)
	GetUrl(ctx context.Context, dingId int64) (string, error)
	PhotoAktualisieren(ctx context.Context, id int64, image image.Image) error
}

func NewSqlRpository

func NewSqlRpository(ctx context.Context, tm sqlx.TransactionManager, clock Clock) (Repository, error)

type SqlRepository

type SqlRepository struct {
	Clock Clock
	Tm    sqlx.TransactionManager
}

func (SqlRepository) GetPhotoById

func (r SqlRepository) GetPhotoById(ctx context.Context, dingId int64) ([]byte, error)

func (SqlRepository) GetUrl

func (r SqlRepository) GetUrl(ctx context.Context, dingId int64) (string, error)

GetUrl liefert die URL des Photos eines Dings.

[id] ist die id eines Dings.

func (SqlRepository) PhotoAktualisieren

func (r SqlRepository) PhotoAktualisieren(ctx context.Context, id int64, image image.Image) error

type UploadHandler

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

Upload nimmt ein neues Photo entgegen und speichert es in der Datenbank

func (UploadHandler) ProcessRequest

func (h UploadHandler) ProcessRequest(fragment string, r *http.Request) webx.HandlerResult

Jump to

Keyboard shortcuts

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