avatar

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_avatar_proto protoreflect.FileDescriptor

Functions

func NewAvatarEndpoints

func NewAvatarEndpoints() []*api.Endpoint

func RegisterAvatarHandler

func RegisterAvatarHandler(s server.Server, hdlr AvatarHandler, opts ...server.HandlerOption) error

Types

type AvatarHandler

type AvatarHandler interface {
	Generate(context.Context, *GenerateRequest, *GenerateResponse) error
}

type AvatarService

type AvatarService interface {
	Generate(ctx context.Context, in *GenerateRequest, opts ...client.CallOption) (*GenerateResponse, error)
}

func NewAvatarService

func NewAvatarService(name string, c client.Client) AvatarService

type GenerateRequest

type GenerateRequest struct {

	// avatar's gender, `male` or `female`, default is `male`
	Gender string `protobuf:"bytes,1,opt,name=gender,proto3" json:"gender,omitempty"`
	// avatar's username, unique username will generates the unique avatar;
	// if username == "", will generate a random avatar in every request
	// if upload == true, username will be used as CDN filename
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// encode format of avatar image, `png` or `jpeg`, default is `jpeg`
	Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"`
	// if upload to m3o CDN, default is `false`
	// if update = true, then it'll return the CDN url
	Upload bool `protobuf:"varint,4,opt,name=upload,proto3" json:"upload,omitempty"`
	// contains filtered or unexported fields
}

func (*GenerateRequest) Descriptor deprecated

func (*GenerateRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead.

func (*GenerateRequest) GetFormat

func (x *GenerateRequest) GetFormat() string

func (*GenerateRequest) GetGender

func (x *GenerateRequest) GetGender() string

func (*GenerateRequest) GetUpload

func (x *GenerateRequest) GetUpload() bool

func (*GenerateRequest) GetUsername

func (x *GenerateRequest) GetUsername() string

func (*GenerateRequest) ProtoMessage

func (*GenerateRequest) ProtoMessage()

func (*GenerateRequest) ProtoReflect

func (x *GenerateRequest) ProtoReflect() protoreflect.Message

func (*GenerateRequest) Reset

func (x *GenerateRequest) Reset()

func (*GenerateRequest) String

func (x *GenerateRequest) String() string

type GenerateResponse

type GenerateResponse struct {

	// Micro's CDN url of the avatar image
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// base64encode string of the avatar image
	Base64 string `protobuf:"bytes,2,opt,name=base64,proto3" json:"base64,omitempty"`
	// contains filtered or unexported fields
}

func (*GenerateResponse) Descriptor deprecated

func (*GenerateResponse) Descriptor() ([]byte, []int)

Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead.

func (*GenerateResponse) GetBase64

func (x *GenerateResponse) GetBase64() string

func (*GenerateResponse) GetUrl

func (x *GenerateResponse) GetUrl() string

func (*GenerateResponse) ProtoMessage

func (*GenerateResponse) ProtoMessage()

func (*GenerateResponse) ProtoReflect

func (x *GenerateResponse) ProtoReflect() protoreflect.Message

func (*GenerateResponse) Reset

func (x *GenerateResponse) Reset()

func (*GenerateResponse) String

func (x *GenerateResponse) String() string

Jump to

Keyboard shortcuts

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