avatars

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: BSD-3-Clause Imports: 6 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) GetBrowserURL

func (srv *Avatars) GetBrowserURL(Code string, optionalSetters ...GetBrowserOption) (*string, error)

GetBrowserURL 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. Returns the URL for the resource instead of the content.

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) GetCreditCardURL

func (srv *Avatars) GetCreditCardURL(Code string, optionalSetters ...GetCreditCardOption) (*string, error)

GetCreditCardURL 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. Returns the URL for the resource instead of the content.

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) GetFaviconURL

func (srv *Avatars) GetFaviconURL(Url string) (*string, error)

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

This endpoint does not follow HTTP redirects. Returns the URL for the resource instead of the content.

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) GetFlagURL

func (srv *Avatars) GetFlagURL(Code string, optionalSetters ...GetFlagOption) (*string, error)

GetFlagURL 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. Returns the URL for the resource instead of the content.

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) GetImageURL

func (srv *Avatars) GetImageURL(Url string, optionalSetters ...GetImageOption) (*string, error)

GetImageURL 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. Returns the URL for the resource instead of the content.

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) GetInitialsURL

func (srv *Avatars) GetInitialsURL(optionalSetters ...GetInitialsOption) (*string, error)

GetInitialsURL 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. Returns the URL for the resource instead of the content.

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) GetQRURL

func (srv *Avatars) GetQRURL(Text string, optionalSetters ...GetQROption) (*string, error)

GetQRURL 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. Returns the URL for the resource instead of the content.

func (*Avatars) GetScreenshot

func (srv *Avatars) GetScreenshot(Url string, optionalSetters ...GetScreenshotOption) (*[]byte, error)

GetScreenshot use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.

You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.

When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.

func (*Avatars) GetScreenshotURL

func (srv *Avatars) GetScreenshotURL(Url string, optionalSetters ...GetScreenshotOption) (*string, error)

GetScreenshotURL use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.

You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.

When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px. Returns the URL for the resource instead of the content.

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

func (*Avatars) WithGetScreenshotAccuracy

func (srv *Avatars) WithGetScreenshotAccuracy(v float64) GetScreenshotOption

func (*Avatars) WithGetScreenshotFullpage

func (srv *Avatars) WithGetScreenshotFullpage(v bool) GetScreenshotOption

func (*Avatars) WithGetScreenshotHeaders

func (srv *Avatars) WithGetScreenshotHeaders(v interface{}) GetScreenshotOption

func (*Avatars) WithGetScreenshotHeight

func (srv *Avatars) WithGetScreenshotHeight(v int) GetScreenshotOption

func (*Avatars) WithGetScreenshotLatitude

func (srv *Avatars) WithGetScreenshotLatitude(v float64) GetScreenshotOption

func (*Avatars) WithGetScreenshotLocale

func (srv *Avatars) WithGetScreenshotLocale(v string) GetScreenshotOption

func (*Avatars) WithGetScreenshotLongitude

func (srv *Avatars) WithGetScreenshotLongitude(v float64) GetScreenshotOption

func (*Avatars) WithGetScreenshotOutput

func (srv *Avatars) WithGetScreenshotOutput(v string) GetScreenshotOption

func (*Avatars) WithGetScreenshotPermissions

func (srv *Avatars) WithGetScreenshotPermissions(v []string) GetScreenshotOption

func (*Avatars) WithGetScreenshotQuality

func (srv *Avatars) WithGetScreenshotQuality(v int) GetScreenshotOption

func (*Avatars) WithGetScreenshotScale

func (srv *Avatars) WithGetScreenshotScale(v float64) GetScreenshotOption

func (*Avatars) WithGetScreenshotSleep

func (srv *Avatars) WithGetScreenshotSleep(v int) GetScreenshotOption

func (*Avatars) WithGetScreenshotTheme

func (srv *Avatars) WithGetScreenshotTheme(v string) GetScreenshotOption

func (*Avatars) WithGetScreenshotTimezone

func (srv *Avatars) WithGetScreenshotTimezone(v string) GetScreenshotOption

func (*Avatars) WithGetScreenshotTouch

func (srv *Avatars) WithGetScreenshotTouch(v bool) GetScreenshotOption

func (*Avatars) WithGetScreenshotUserAgent

func (srv *Avatars) WithGetScreenshotUserAgent(v string) GetScreenshotOption

func (*Avatars) WithGetScreenshotViewportHeight

func (srv *Avatars) WithGetScreenshotViewportHeight(v int) GetScreenshotOption

func (*Avatars) WithGetScreenshotViewportWidth

func (srv *Avatars) WithGetScreenshotViewportWidth(v int) GetScreenshotOption

func (*Avatars) WithGetScreenshotWidth

func (srv *Avatars) WithGetScreenshotWidth(v int) GetScreenshotOption

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

type GetScreenshotOption

type GetScreenshotOption func(*GetScreenshotOptions)

type GetScreenshotOptions

type GetScreenshotOptions struct {
	Headers        interface{}
	ViewportWidth  int
	ViewportHeight int
	Scale          float64
	Theme          string
	UserAgent      string
	Fullpage       bool
	Locale         string
	Timezone       string
	Latitude       float64
	Longitude      float64
	Accuracy       float64
	Touch          bool
	Permissions    []string
	Sleep          int
	Width          int
	Height         int
	Quality        int
	Output         string
	// contains filtered or unexported fields
}

func (GetScreenshotOptions) New

Jump to

Keyboard shortcuts

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