organisationsnummer

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 3 Imported by: 0

README

organisationsnummer GitHub Workflow Status GoDoc Go Report Card

Validate Swedish organization numbers.

Installation

go get -u github.com/organisationsnummer/go

Example

package main

import (
	organisationsnummer "github.com/organisationsnummer/go"
)

func main() {
	organisationsnummer.Valid("202100-5489")
	//=> true
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOrganizationNumber = errors.New("Invalid Swedish organization number")
)

Functions

func Valid

func Valid(input string) bool

Valid will validate Swedish organization numbers

Types

type Organisationsnummer

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

Organisationsnummer represents the organisationsnummer struct.

func New

func New(input string) (*Organisationsnummer, error)

New parse a Swedish organization numbers and returns a new struct or a error.

func Parse

func Parse(input string) (*Organisationsnummer, error)

Parse Swedish organization numbers and return a new struct.

func (*Organisationsnummer) Format

func (o *Organisationsnummer) Format(separator ...bool) string

Format a Swedish organization number as one of the official formats, a long format or a short format.

func (*Organisationsnummer) GetType

func (o *Organisationsnummer) GetType() string

Get the organization type.

func (*Organisationsnummer) IsPersonnummer

func (o *Organisationsnummer) IsPersonnummer() bool

Determine if personnummer or not.

func (*Organisationsnummer) Personnummer

func (o *Organisationsnummer) Personnummer() personnummer.Personnummer

Get Personnummer instance

func (*Organisationsnummer) String

func (o *Organisationsnummer) String() string

Get the organization type.

func (*Organisationsnummer) VatNumber added in v1.0.2

func (o *Organisationsnummer) VatNumber() string

Get vat number for a organization number.

Jump to

Keyboard shortcuts

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