rut

package
v0.0.0-...-2754710 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCaptchaCode       = errors.New("unexpected response: no captcha code")
	ErrInvalidCaptchaCode  = errors.New("unexpected response: captcha code is not a string")
	ErrTooShortCaptchaCode = errors.New("unexpected response: captcha code is too short")
)
View Source
var ErrInvalidRUT = errors.New("invalid rut")

Functions

func DigitHandler

func DigitHandler(ctx *gin.Context)

func GetCaptcha

func GetCaptcha() (code string, captcha string, err error)

func GetReverseSequence

func GetReverseSequence(length int) (s []int)

func SIIActivityHandler

func SIIActivityHandler(ctx *gin.Context)

func VDToString

func VDToString(vd int) string

func ValidateHandler

func ValidateHandler(ctx *gin.Context)

Types

type EconomicActivity

type EconomicActivity struct {
	Name         string    `json:"name"`
	Code         int       `json:"code"`
	Category     string    `json:"category"`
	SubjectToVAT bool      `json:"subject_to_vat"`
	Date         time.Time `json:"date"`
}

type RUT

type RUT []int

func ParseRUT

func ParseRUT(rut string) (RUT, error)

func (RUT) CalculateVD

func (r RUT) CalculateVD(ignoreLast bool) int

func (RUT) GetVDString

func (r RUT) GetVDString() string

func (RUT) IsValid

func (r RUT) IsValid() bool

func (RUT) PrettyString

func (r RUT) PrettyString() string

func (RUT) String

func (r RUT) String() string

type SIIDetail

type SIIDetail struct {
	Name       string
	Activities []EconomicActivity
}

func GetSIIDetails

func GetSIIDetails(r RUT) (SIIDetail, error)

func ParseHTML

func ParseHTML(r io.ReadCloser) (SIIDetail, error)

Jump to

Keyboard shortcuts

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