bingimg

package
v0.0.0-...-02b0d32 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const Auth_Kiev = "" /* 1488-byte string literal not displayed */
View Source
const BASE_ENDPOINT = "https://www.bing.com/images/create"
View Source
const BING_URL = "https://www.bing.com"

Variables

View Source
var BadImagesLinks = []string{
	"https://r.bing.com/rp/in-2zU3AJUdkgFe7ZKv19yPBHVs.png",
	"https://r.bing.com/rp/TX9QuO3WzcCJz1uaaSwQAz39Kb0.jpg",
}

Functions

This section is empty.

Types

type BingImage

type BingImage struct {
	Filename string
	Data     string
}

Image is a struct that holds the filename and data of an image

type BingImageClient

type BingImageClient struct {
	Headers map[string]string
	Data    url.Values
	Cookies []*http.Cookie
	Options IOptions
	Client  *http.Client
}

func NewBingImageClient

func NewBingImageClient(options IOptions) *BingImageClient

type BingImgWork

type BingImgWork struct {
	Cookies    []*http.Cookie
	Client     *http.Client
	AuthCookie string
	Name       string
}

func NewBingImage

func NewBingImage(cookie string) *BingImgWork

NewBingImage is a function that creates and returns a new BingImage with the given parameters

type Config

type Config struct {
	BingImageCookie string
	TempDir         string
}

Config is a struct that holds the configuration options

type IOptions

type IOptions struct {
	Dir    string
	Notify bool
	Token  string
}

type ImageGen

type ImageGen struct {
	Thumbnail bool
	// contains filtered or unexported fields
}

func NewImageGen

func NewImageGen(authCookie string, quiet bool, debugFile string) (*ImageGen, error)

func (*ImageGen) GetImages

func (self *ImageGen) GetImages(prompt string) ([]string, error)

func (*ImageGen) MakeThumbnail

func (c *ImageGen) MakeThumbnail(sign bool)

func (*ImageGen) SaveImages

func (c *ImageGen) SaveImages(links []string, outputDir string, fileName string) ([]string, error)

func (*ImageGen) UpdateHeader

func (c *ImageGen) UpdateHeader()

Jump to

Keyboard shortcuts

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