segcha

package
v0.0.0-...-e9c30ff Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, address string) (segchaproto.SegchaClient, func() error, error)

NewClient returns a new client for making remote challenge generation calls The connection to `address` is not secured! It is assumed that it is protected externally (e.g. through an SSH tunnel)

Types

type Challenge

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

func NewChallenge

func NewChallenge(steps int, imageDB *ImageDatabase, fontPath string) (*Challenge, error)

NewChallenge returns a new challenge

func NewChallengeUsingClient

func NewChallengeUsingClient(ctx context.Context, steps int, client segchaproto.SegchaClient) (*Challenge, error)

NewChallengeUsingClient requests the generation of a challenge using the provided client and returns it

func (*Challenge) Answers

func (c *Challenge) Answers() []int

func (*Challenge) ID

func (c *Challenge) ID() string

func (*Challenge) Pictures

func (c *Challenge) Pictures() [][]byte

type ImageDatabase

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

func NewImageDatabase

func NewImageDatabase(imagesFolder string) (*ImageDatabase, error)

func (*ImageDatabase) GetAnyPicture

func (i *ImageDatabase) GetAnyPicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetBrokenGlassPicture

func (i *ImageDatabase) GetBrokenGlassPicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetCGIPicture

func (i *ImageDatabase) GetCGIPicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetGlassBottlePicture

func (i *ImageDatabase) GetGlassBottlePicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetGlassPicture

func (i *ImageDatabase) GetGlassPicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetOrientablePicture

func (i *ImageDatabase) GetOrientablePicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetPhotoPicture

func (i *ImageDatabase) GetPhotoPicture(rng *rand.Rand) (image.Image, error)

func (*ImageDatabase) GetUnbrokenGlassPicture

func (i *ImageDatabase) GetUnbrokenGlassPicture(rng *rand.Rand) (image.Image, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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