Documentation
¶
Index ¶
- Constants
- type AuthResponse
- type Client
- func (c *Client) Patrols(days int, status string) (*PatrolsResponse, error)
- func (c *Client) SubjectTracks(subjectID string, daysAgo int) (*TracksResponse, error)
- func (c *Client) Subjects(updatedSince string) (*SubjectsResponse, error)
- func (c *Client) User() (*UserResponse, error)
- func (c *Client) UserProfiles(userID string) (*UserProfilesResponse, error)
- type Coordinate
- type DateRangeFilter
- type Feature
- type Geometry
- type LastPosition
- type Location
- type Patrol
- type PatrolSegment
- type PatrolsResponse
- type Properties
- type Subject
- type SubjectsResponse
- type TimeRange
- type TrackGeometry
- type TrackProperties
- type TracksResponse
- type UserData
- type UserProfilesResponse
- type UserResponse
Constants ¶
View Source
const API_ACTIVITY = API_V1 + "/activity"
View Source
const API_AUTH = "/oauth2/token"
View Source
const API_PATROLS = API_ACTIVITY + "/patrols"
View Source
const API_SUBJECT = API_V1 + "/subject"
View Source
const API_SUBJECTS = API_V1 + "/subjects"
View Source
const API_SUBJECT_TRACKS = "/tracks"
View Source
const API_USER = API_V1 + "/user"
View Source
const API_USER_ME = API_USER + "/me"
View Source
const API_USER_PROFILES = "/profiles"
View Source
const API_V1 = "/api/v1.0"
View Source
const DOMAIN = ".pamdas.org"
---------------------------------------------- const endpoints ----------------------------------------------
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
TokenType string `json:"token_type"`
Scope string `json:"scope"`
RefreshToken string `json:"refresh_token"`
ErrorDescription string `json:"error_description"`
}
---------------------------------------------- structs ----------------------------------------------
func Authenticate ¶
func Authenticate(sitename, username, password string) (*AuthResponse, error)
---------------------------------------------- exported functions ----------------------------------------------
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Patrols ¶ added in v0.0.3
func (c *Client) Patrols(days int, status string) (*PatrolsResponse, error)
func (*Client) SubjectTracks ¶ added in v0.0.2
func (c *Client) SubjectTracks(subjectID string, daysAgo int) (*TracksResponse, error)
func (*Client) Subjects ¶ added in v0.0.2
func (c *Client) Subjects(updatedSince string) (*SubjectsResponse, error)
func (*Client) User ¶ added in v0.0.2
func (c *Client) User() (*UserResponse, error)
func (*Client) UserProfiles ¶ added in v0.0.2
func (c *Client) UserProfiles(userID string) (*UserProfilesResponse, error)
type Coordinate ¶ added in v0.0.2
type Coordinate struct {
Time string `json:"time"`
}
type DateRangeFilter ¶ added in v0.0.3
type Feature ¶ added in v0.0.2
type Feature struct {
Geometry TrackGeometry `json:"geometry"`
Properties TrackProperties `json:"properties"`
Type string `json:"type"`
}
type LastPosition ¶ added in v0.0.2
type LastPosition struct {
Geometry Geometry `json:"geometry"`
Properties Properties `json:"properties"`
Type string `json:"type"`
}
type Patrol ¶ added in v0.0.3
type Patrol struct {
ID string `json:"id"`
SerialNumber int `json:"serial_number"`
State string `json:"state"`
Title *string `json:"title"`
PatrolSegments []PatrolSegment `json:"patrol_segments"`
}
type PatrolSegment ¶ added in v0.0.3
type PatrolsResponse ¶ added in v0.0.3
type Properties ¶ added in v0.0.2
type Properties struct {
DateTime string `json:"DateTime"`
CoordinateProperties Coordinate `json:"coordinateProperties"`
ID string `json:"id"`
Image string `json:"image"`
LastVoiceCallStartAt *string `json:"last_voice_call_start_at"`
LocationRequestedAt *string `json:"location_requested_at"`
RadioState string `json:"radio_state"`
RadioStateAt string `json:"radio_state_at"`
Stroke string `json:"stroke"`
StrokeOpacity float64 `json:"stroke-opacity"`
StrokeWidth int `json:"stroke-width"`
SubjectSubtype string `json:"subject_subtype"`
SubjectType string `json:"subject_type"`
Title string `json:"title"`
}
type SubjectsResponse ¶ added in v0.0.2
type TrackGeometry ¶ added in v0.0.2
type TrackProperties ¶ added in v0.0.2
type TrackProperties struct {
CoordinateProperties struct {
Times []string `json:"times"`
} `json:"coordinateProperties"`
ID string `json:"id"`
Image string `json:"image"`
LastVoiceCallStartAt *string `json:"last_voice_call_start_at"`
LocationRequestedAt *string `json:"location_requested_at"`
RadioState string `json:"radio_state"`
RadioStateAt string `json:"radio_state_at"`
Stroke string `json:"stroke"`
StrokeOpacity float64 `json:"stroke-opacity"`
StrokeWidth int `json:"stroke-width"`
SubjectSubtype string `json:"subject_subtype"`
SubjectType string `json:"subject_type"`
Title string `json:"title"`
}
type TracksResponse ¶ added in v0.0.2
type UserData ¶
type UserData struct {
Username string `json:"username"`
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Role string `json:"role"`
IsStaff bool `json:"is_staff"`
IsSuperUser bool `json:"is_superuser"`
DateJoined string `json:"date_joined"`
ID string `json:"id"`
IsActive bool `json:"is_active"`
LastLogin string `json:"last_login"`
Pin string `json:"pin"`
Subject struct {
ID string `json:"id"`
} `json:"subject"`
AcceptedEula bool `json:"accepted_eula"`
}
type UserProfilesResponse ¶
type UserResponse ¶
Click to show internal directories.
Click to hide internal directories.