controller

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	User  interface{ User }
	Image interface{ Image }
}

Controller holds the User and Image controllers.

type Image

type Image interface {
	Get(
		ctx context.Context,
		entUser ent.User,
		id *ulid.ID,
	) (*ent.Image, error)
	List(
		ctx context.Context,
		entUser ent.User,
		after *ent.Cursor,
		first *int,
		before *ent.Cursor,
		last *int,
		where *ent.ImageWhereInput,
		orderBy *ent.ImageOrder,
	) (*ent.ImageConnection, error)
	Create(
		ctx context.Context,
		entUser ent.User,
		filename string,
		content string,
	) (*ent.Image, error)
	Count(
		ctx context.Context,
		entUser ent.User,
	) (int, error)
}

Image Controller interface.

type User

type User interface {
	GetByID(
		ctx context.Context,
		id ulid.ID,
	) (*ent.User, error)
	GetByEmail(
		ctx context.Context,
		email string,
	) (*ent.User, error)
	Create(
		ctx context.Context,
		input gqlgen.NewUser,
	) (*ent.User, error)
	Update(
		ctx context.Context,
		entUser ent.User,
		input gqlgen.UpdateUser,
	) (*ent.User, error)
	SetLoggedIn(
		ctx context.Context,
		entUser ent.User,
	) (*ent.User, error)
}

User Controller interface.

Jump to

Keyboard shortcuts

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