Documentation ¶
Index ¶
- func NewClient(ctx context.Context, address string) (segchaproto.SegchaClient, func() error, error)
- type Challenge
- type ImageDatabase
- func (i *ImageDatabase) GetAnyPicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetBrokenGlassPicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetCGIPicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetGlassBottlePicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetGlassPicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetOrientablePicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetPhotoPicture(rng *rand.Rand) (image.Image, error)
- func (i *ImageDatabase) GetUnbrokenGlassPicture(rng *rand.Rand) (image.Image, error)
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
type ImageDatabase ¶
type ImageDatabase struct {
// contains filtered or unexported fields
}
func NewImageDatabase ¶
func NewImageDatabase(imagesFolder string) (*ImageDatabase, error)
func (*ImageDatabase) GetAnyPicture ¶
func (*ImageDatabase) GetBrokenGlassPicture ¶
func (*ImageDatabase) GetCGIPicture ¶
func (*ImageDatabase) GetGlassBottlePicture ¶
func (*ImageDatabase) GetGlassPicture ¶
func (*ImageDatabase) GetOrientablePicture ¶
func (*ImageDatabase) GetPhotoPicture ¶
func (*ImageDatabase) GetUnbrokenGlassPicture ¶
Click to show internal directories.
Click to hide internal directories.