avatars

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avatars

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

Avatars service

func New

func New(clt client.Client) *Avatars

func (*Avatars) GetBrowser

func (srv *Avatars) GetBrowser(Code string, optionalSetters ...GetBrowserOption) (*[]byte, error)

GetBrowser you can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

func (*Avatars) GetCreditCard

func (srv *Avatars) GetCreditCard(Code string, optionalSetters ...GetCreditCardOption) (*[]byte, error)

GetCreditCard the credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

func (*Avatars) GetFavicon

func (srv *Avatars) GetFavicon(Url string) (*[]byte, error)

GetFavicon use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.

This endpoint does not follow HTTP redirects.

func (*Avatars) GetFlag

func (srv *Avatars) GetFlag(Code string, optionalSetters ...GetFlagOption) (*[]byte, error)

GetFlag you can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

func (*Avatars) GetImage

func (srv *Avatars) GetImage(Url string, optionalSetters ...GetImageOption) (*[]byte, error)

GetImage use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.

This endpoint does not follow HTTP redirects.

func (*Avatars) GetInitials

func (srv *Avatars) GetInitials(optionalSetters ...GetInitialsOption) (*[]byte, error)

GetInitials use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.

You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

func (*Avatars) GetQR

func (srv *Avatars) GetQR(Text string, optionalSetters ...GetQROption) (*[]byte, error)

GetQR converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.

func (*Avatars) WithGetBrowserHeight

func (srv *Avatars) WithGetBrowserHeight(v int) GetBrowserOption

func (*Avatars) WithGetBrowserQuality

func (srv *Avatars) WithGetBrowserQuality(v int) GetBrowserOption

func (*Avatars) WithGetBrowserWidth

func (srv *Avatars) WithGetBrowserWidth(v int) GetBrowserOption

func (*Avatars) WithGetCreditCardHeight

func (srv *Avatars) WithGetCreditCardHeight(v int) GetCreditCardOption

func (*Avatars) WithGetCreditCardQuality

func (srv *Avatars) WithGetCreditCardQuality(v int) GetCreditCardOption

func (*Avatars) WithGetCreditCardWidth

func (srv *Avatars) WithGetCreditCardWidth(v int) GetCreditCardOption

func (*Avatars) WithGetFlagHeight

func (srv *Avatars) WithGetFlagHeight(v int) GetFlagOption

func (*Avatars) WithGetFlagQuality

func (srv *Avatars) WithGetFlagQuality(v int) GetFlagOption

func (*Avatars) WithGetFlagWidth

func (srv *Avatars) WithGetFlagWidth(v int) GetFlagOption

func (*Avatars) WithGetImageHeight

func (srv *Avatars) WithGetImageHeight(v int) GetImageOption

func (*Avatars) WithGetImageWidth

func (srv *Avatars) WithGetImageWidth(v int) GetImageOption

func (*Avatars) WithGetInitialsBackground

func (srv *Avatars) WithGetInitialsBackground(v string) GetInitialsOption

func (*Avatars) WithGetInitialsHeight

func (srv *Avatars) WithGetInitialsHeight(v int) GetInitialsOption

func (*Avatars) WithGetInitialsName

func (srv *Avatars) WithGetInitialsName(v string) GetInitialsOption

func (*Avatars) WithGetInitialsWidth

func (srv *Avatars) WithGetInitialsWidth(v int) GetInitialsOption

func (*Avatars) WithGetQRDownload

func (srv *Avatars) WithGetQRDownload(v bool) GetQROption

func (*Avatars) WithGetQRMargin

func (srv *Avatars) WithGetQRMargin(v int) GetQROption

func (*Avatars) WithGetQRSize

func (srv *Avatars) WithGetQRSize(v int) GetQROption

type GetBrowserOption

type GetBrowserOption func(*GetBrowserOptions)

type GetBrowserOptions

type GetBrowserOptions struct {
	Width   int
	Height  int
	Quality int
	// contains filtered or unexported fields
}

func (GetBrowserOptions) New

func (options GetBrowserOptions) New() *GetBrowserOptions

type GetCreditCardOption

type GetCreditCardOption func(*GetCreditCardOptions)

type GetCreditCardOptions

type GetCreditCardOptions struct {
	Width   int
	Height  int
	Quality int
	// contains filtered or unexported fields
}

func (GetCreditCardOptions) New

type GetFlagOption

type GetFlagOption func(*GetFlagOptions)

type GetFlagOptions

type GetFlagOptions struct {
	Width   int
	Height  int
	Quality int
	// contains filtered or unexported fields
}

func (GetFlagOptions) New

func (options GetFlagOptions) New() *GetFlagOptions

type GetImageOption

type GetImageOption func(*GetImageOptions)

type GetImageOptions

type GetImageOptions struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

func (GetImageOptions) New

func (options GetImageOptions) New() *GetImageOptions

type GetInitialsOption

type GetInitialsOption func(*GetInitialsOptions)

type GetInitialsOptions

type GetInitialsOptions struct {
	Name       string
	Width      int
	Height     int
	Background string
	// contains filtered or unexported fields
}

func (GetInitialsOptions) New

func (options GetInitialsOptions) New() *GetInitialsOptions

type GetQROption

type GetQROption func(*GetQROptions)

type GetQROptions

type GetQROptions struct {
	Size     int
	Margin   int
	Download bool
	// contains filtered or unexported fields
}

func (GetQROptions) New

func (options GetQROptions) New() *GetQROptions

Jump to

Keyboard shortcuts

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