models

package
v0.0.0-...-85d6a38 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int32
const (
	Unknown ErrorCode = iota
	Internal
	InvalidArgument
	Unauthenticated
	Conflict
	NotFound
	Canceled
	DeadlineExceeded
	PermissionDenied
)

func Code

func Code(err error) ErrorCode

func (ErrorCode) String

func (t ErrorCode) String() string

type ProcessedImageResponse

type ProcessedImageResponse struct {
	Img         []byte
	ContentType string
}

type ServiceError

type ServiceError struct {
	Msg  string
	Code ErrorCode
}

func Error

func Error(code ErrorCode, msg string) *ServiceError

func Errorf

func Errorf(code ErrorCode, format string, a ...any) *ServiceError

func (*ServiceError) Error

func (e *ServiceError) Error() string

type ValidateRequest

type ValidateRequest struct {
	Img            []byte
	SupportedTypes []string

	MaxWidth  *int32
	MaxHeight *int32
	MinWidth  *int32
	MinHeight *int32
}

type ValidateResponse

type ValidateResponse struct {
	IsImageValid bool
	// If IsImageValid is false will contains message about failed check
	Details string
}

Jump to

Keyboard shortcuts

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