api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsuccessfulRequest = errors.New("unsuccessful request")

Functions

func IsBadgeExistsError

func IsBadgeExistsError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

Types

type Conn

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

func NewConn

func NewConn(urlPrefix, username, password string) (*Conn, error)

func (*Conn) CreatePerson

func (c *Conn) CreatePerson(p *Person) (id int, err error)

func (*Conn) DeletePerson

func (c *Conn) DeletePerson(id int) error

func (*Conn) ListGroups

func (c *Conn) ListGroups() ([]*Group, error)

func (*Conn) ListPeople

func (c *Conn) ListPeople() ([]*Person, error)

func (*Conn) ReadPerson

func (c *Conn) ReadPerson(id int) (*Person, error)

func (*Conn) UpdatePerson

func (c *Conn) UpdatePerson(p *Person) error

type Error

type Error struct {
	ID  string `json:"id"`
	Msg string `json:"msg"`
}

func (*Error) Error

func (e *Error) Error() string

type Errors

type Errors []*Error

func (Errors) Error

func (e Errors) Error() string

type Group

type Group struct {
	ID   int
	Name string
}

type Person

type Person struct {
	ID          int
	FirstName   string
	LastName    string
	EmployeeID  string
	Department  string
	SiteCode    int
	CardCode    int
	GroupsToAdd []int
}

type Response

type Response struct {
	Success  bool        `json:"success"`
	ID       int         `json:"RecordId"`
	Data     interface{} `json:"data,omitempty"`
	Errors   `json:"errors"`
	ErrorMsg string `json:"errorMsg"`
}

func (*Response) Error

func (r *Response) Error() error

Jump to

Keyboard shortcuts

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