Documentation ¶
Index ¶
- Variables
- func HTTPErrorCode(err error) int
- type Credential
- type Group
- type HTTPError
- type Person
- type Service
- func (s *Service) CreateCredential(id int, cred *Credential) (int, error)
- func (s *Service) CreateCredentialHandler(r *http.Request) (interface{}, error)
- func (s *Service) CreatePerson(p *Person) (int, error)
- func (s *Service) CreatePersonHandler(r *http.Request) (interface{}, error)
- func (s *Service) DeleteCredential(id, credID int) error
- func (s *Service) DeleteCredentialHandler(r *http.Request) error
- func (s *Service) DeletePerson(id int) error
- func (s *Service) DeletePersonHandler(r *http.Request) error
- func (s *Service) HandleJSON(next func(r *http.Request) (interface{}, error)) http.Handler
- func (s *Service) Handler() http.Handler
- func (s *Service) ListCredentials(id int) ([]*Credential, error)
- func (s *Service) ListCredentialsHandler(r *http.Request) (interface{}, error)
- func (s *Service) ListGroups() ([]*Group, error)
- func (s *Service) ListGroupsHandler(r *http.Request) (interface{}, error)
- func (s *Service) ListPeople() ([]*Person, error)
- func (s *Service) ListPeopleHandler(r *http.Request) (interface{}, error)
- func (s *Service) ReadPerson(id int) (*Person, error)
- func (s *Service) ReadPersonHandler(r *http.Request) (interface{}, error)
- func (s *Service) UpdatePerson(p *Person) error
- func (s *Service) UpdatePersonHandler(r *http.Request) (interface{}, error)
- func (s *Service) WithAuth(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidAuthorization = errors.New("invalid authorization")
View Source
var ErrInvalidID = errors.New("invalid id")
Functions ¶
func HTTPErrorCode ¶
Types ¶
type Credential ¶ added in v1.2.0
type Person ¶
type Person struct { ID int `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` EmployeeID string `json:"employee_id"` Department string `json:"department"` SiteCode int `json:"site_code"` CardCode int `json:"card_code"` Image []byte `json:"image,omitempty"` HasImage bool `json:"has_image"` GroupsToAdd []int `json:"groups_to_add,omitempty"` Credentials []*Credential `json:"credentials,omitempty"` }
type Service ¶
func (*Service) CreateCredential ¶ added in v1.2.0
func (s *Service) CreateCredential(id int, cred *Credential) (int, error)
func (*Service) CreateCredentialHandler ¶ added in v1.2.0
func (*Service) CreatePersonHandler ¶
func (*Service) DeleteCredential ¶ added in v1.2.0
func (*Service) DeleteCredentialHandler ¶ added in v1.2.0
func (*Service) DeletePerson ¶
func (*Service) HandleJSON ¶
func (*Service) ListCredentials ¶ added in v1.2.0
func (s *Service) ListCredentials(id int) ([]*Credential, error)
func (*Service) ListCredentialsHandler ¶ added in v1.2.0
func (*Service) ListGroups ¶
func (*Service) ListGroupsHandler ¶
func (*Service) ListPeople ¶
func (*Service) ListPeopleHandler ¶ added in v1.2.0
func (*Service) ReadPersonHandler ¶
func (*Service) UpdatePerson ¶
func (*Service) UpdatePersonHandler ¶
Click to show internal directories.
Click to hide internal directories.