davinci

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeImage

func DecodeImage(r io.Reader) (image.Image, error)

func LoadFont

func LoadFont(fs fs.FS, name string) (*truetype.Font, error)

func LoadTemplate

func LoadTemplate(fs fs.FS, name string) (image.Image, error)

Types

type EncodedImage

type EncodedImage struct {
	Buf         []byte
	Extension   string
	ContentType string
}

type Generator

type Generator interface {
	Generate(avatar io.Reader, name, message string) (*EncodedImage, error)
}

type GrpcServer

type GrpcServer struct {
	davinci.UnimplementedDavinciServer
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(token string, wg Generator, client *http.Client) *GrpcServer

func (*GrpcServer) SendWelcome

func (s *GrpcServer) SendWelcome(
	ctx context.Context,
	req *davinci.WelcomeRequest,
) (*emptypb.Empty, error)

SendWelcome implements davinci.DavinciServer.

type WelcomeGenerator

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

func NewWelcomeGenerator

func NewWelcomeGenerator(
	template image.Image,
	ttf *truetype.Font,
	quality float32,
) *WelcomeGenerator

func (*WelcomeGenerator) Generate

func (g *WelcomeGenerator) Generate(avatar io.Reader, name, message string) (*EncodedImage, error)

Generate implements Generator.

Jump to

Keyboard shortcuts

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