Documentation ¶
Index ¶
- Constants
- type AuthResponse
- type AutoAuth
- type DeviceDetails
- type DeviceList
- type DeviceTrust
- type DeviceTrustResponse
- type LoginRequest
- type PasswordResetRequest
- type RequestPasswordResetRequest
- type StepCreateRequest
- type StepDetails
- type StepList
- type StepMeta
- type TaskCreateRequest
- type TaskDetails
- type TaskList
- type TaskMeta
- type UserCreateRequest
- type UserDetails
- type UserList
- type UserMeta
Constants ¶
const ( JsKeyApiKey = "apiKey" JsKeyAssignees = "assignees" JsKeyCreated = "created" JsKeyCreator = "creator" JsKeyDeleted = "deleted" JsKeyDescription = "description" JsKeyDeviceId = "deviceId" JsKeyDeviceName = "deviceName" JsKeyDisplayName = "displayName" JsKeyEmail = "email" JsKeyId = "id" JsKeyLastLogin = "lastLogin" JsKeyName = "name" JsKeyPassword = "password" JsKeyPosition = "position" JsKeyProviders = "providers" JsKeySince = "since" JsKeySteps = "steps" JsKeySupports = "supports" JsKeyTask = "task" JsKeyTaskId = "taskId" JsKeyToken = "token" JsKeyTrusted = "trusted" JsKeyUpdated = "updated" JsKeyUserId = "userId" )
JSON object key name constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
AuthResponse defines the response body for a successful authentication request.
func (AuthResponse) IsNil ¶
func (a AuthResponse) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (AuthResponse) MarshalJSONObject ¶
func (a AuthResponse) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*AuthResponse) NKeys ¶
func (a *AuthResponse) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*AuthResponse) UnmarshalJSONObject ¶
func (a *AuthResponse) UnmarshalJSONObject(dec *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type AutoAuth ¶
type AutoAuth struct { // UserId is the database Id for the user record to which the device that is // attempting auth belongs. UserId uint64 // DeviceId is a 128bit token generated by the device. // // This value is not used for the web app as auto-auth is not allowed for that // context. // // For phone apps, this will be generated on first launch per user/per device. DeviceId apitoken.Token128 // Token is a 256bit token provided to the device by the HTTP API. Token apitoken.Token256 }
AutoAuth defines the request body for automatic/device authentication requests.
func (*AutoAuth) MarshalJSONObject ¶
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
type DeviceDetails ¶
type DeviceDetails struct { // Id is the sequential datastore ID assigned to this device record. Id uint64 // DeviceId is a token generated by a phone app to identify that phone and // enable automatic authentication for that device. DeviceId apitoken.Token128 // DeviceName is the reported name of the device/browser. DeviceName string // DisplayName is an optional, custom, user provided name for the device. DisplayName string // LastLogin contains the last login time for a device. LastLogin time.Time // Trusted contains details about the "trust" status for a device. Trusted *DeviceTrust }
DeviceDetails defines the available information about a user device.
A device may be from either the web app or the phone app.
func (*DeviceDetails) IsNil ¶
func (d *DeviceDetails) IsNil() bool
func (*DeviceDetails) MarshalJSONObject ¶
func (d *DeviceDetails) MarshalJSONObject(e *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*DeviceDetails) NKeys ¶
func (d *DeviceDetails) NKeys() int
func (*DeviceDetails) UnmarshalJSONObject ¶
func (d *DeviceDetails) UnmarshalJSONObject(e *gojay.Decoder, k string) error
type DeviceList ¶
type DeviceList []DeviceDetails
func (DeviceList) IsNil ¶
func (d DeviceList) IsNil() bool
func (DeviceList) MarshalJSONArray ¶
func (d DeviceList) MarshalJSONArray(e *gojay.Encoder)
func (*DeviceList) UnmarshalJSONArray ¶
func (d *DeviceList) UnmarshalJSONArray(e *gojay.Decoder) error
type DeviceTrust ¶
func (*DeviceTrust) IsNil ¶
func (d *DeviceTrust) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*DeviceTrust) MarshalJSONObject ¶
func (d *DeviceTrust) MarshalJSONObject(e *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*DeviceTrust) NKeys ¶
func (d *DeviceTrust) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*DeviceTrust) UnmarshalJSONObject ¶
func (d *DeviceTrust) UnmarshalJSONObject(e *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type DeviceTrustResponse ¶
func (DeviceTrustResponse) IsNil ¶
func (t DeviceTrustResponse) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*DeviceTrustResponse) MarshalJSONObject ¶
func (t *DeviceTrustResponse) MarshalJSONObject(e *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*DeviceTrustResponse) NKeys ¶
func (t *DeviceTrustResponse) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*DeviceTrustResponse) UnmarshalJSONObject ¶
func (t *DeviceTrustResponse) UnmarshalJSONObject(d *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type LoginRequest ¶
LoginRequest defines the body of an authentication request to the HTTP service using user credentials.
func (*LoginRequest) IsNil ¶
func (l *LoginRequest) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*LoginRequest) MarshalJSONObject ¶
func (l *LoginRequest) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*LoginRequest) NKeys ¶
func (l *LoginRequest) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*LoginRequest) UnmarshalJSONObject ¶
func (l *LoginRequest) UnmarshalJSONObject(dec *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type PasswordResetRequest ¶
type PasswordResetRequest struct { // Database ID of the user record to update. UserId uint64 // Password reset token (will have been sent to the user's email) Token apitoken.Token256 // New password value Password passwd.Password }
PasswordResetRequest defines the body of a request to the HTTP service to update a user's password to the given value.
func (*PasswordResetRequest) IsNil ¶
func (p *PasswordResetRequest) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*PasswordResetRequest) MarshalJSONObject ¶
func (p *PasswordResetRequest) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*PasswordResetRequest) NKeys ¶
func (p *PasswordResetRequest) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*PasswordResetRequest) UnmarshalJSONObject ¶
func (p *PasswordResetRequest) UnmarshalJSONObject(d *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type RequestPasswordResetRequest ¶
type RequestPasswordResetRequest struct {
Email string
}
RequestPasswordResetRequest defines the body of a request to the HTTP server to send a password reset to the given email (provided that email is attached to a known user).
func (*RequestPasswordResetRequest) IsNil ¶
func (r *RequestPasswordResetRequest) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*RequestPasswordResetRequest) MarshalJSONObject ¶
func (r *RequestPasswordResetRequest) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*RequestPasswordResetRequest) NKeys ¶
func (r *RequestPasswordResetRequest) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*RequestPasswordResetRequest) UnmarshalJSONObject ¶
func (r *RequestPasswordResetRequest) UnmarshalJSONObject(d *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type StepCreateRequest ¶
func (*StepCreateRequest) IsNil ¶
func (s *StepCreateRequest) IsNil() bool
func (*StepCreateRequest) MarshalJSONObject ¶
func (s *StepCreateRequest) MarshalJSONObject(e *gojay.Encoder)
func (*StepCreateRequest) NKeys ¶
func (s *StepCreateRequest) NKeys() int
func (*StepCreateRequest) UnmarshalJSONObject ¶
func (s *StepCreateRequest) UnmarshalJSONObject(d *gojay.Decoder, k string) error
type StepDetails ¶
type StepDetails struct { Id uint64 Task TaskDetails Description string Position uint16 Creator UserMeta Created time.Time Updated time.Time Deleted *time.Time }
func (StepDetails) IsNil ¶
func (s StepDetails) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (StepDetails) MarshalJSONObject ¶
func (s StepDetails) MarshalJSONObject(e *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*StepDetails) NKeys ¶
func (*StepDetails) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*StepDetails) UnmarshalJSONObject ¶
func (s *StepDetails) UnmarshalJSONObject(d *gojay.Decoder, k string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type StepMeta ¶
func (StepMeta) MarshalJSONObject ¶
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
type TaskCreateRequest ¶
func (*TaskCreateRequest) IsNil ¶
func (t *TaskCreateRequest) IsNil() bool
func (*TaskCreateRequest) MarshalJSONObject ¶
func (t *TaskCreateRequest) MarshalJSONObject(e *gojay.Encoder)
func (*TaskCreateRequest) NKeys ¶
func (t *TaskCreateRequest) NKeys() int
func (*TaskCreateRequest) UnmarshalJSONObject ¶
func (t *TaskCreateRequest) UnmarshalJSONObject(d *gojay.Decoder, k string) error
type TaskDetails ¶
type TaskDetails struct { TaskMeta // User provided description of the task. Description string // User metadata for the user that created the task. Creator UserMeta // User metadata for the users to whom this task is assigned. // // This value will only be populated with users that the current user is // marked as a provider for. // // If the current user is not a provider, the task has no assignees, or the // task is self assigned, this field will be omitted by the server. Assignees UserList // An optional list of steps that make up the current task. Steps StepList // Timestamp of when this task was created. Created time.Time // Timestamp of when this task was last updated. Updated time.Time // Optional timestamp of when this task was deleted (only present if the task // actually has been deleted). Deleted *time.Time }
TaskDetails represents a "full" task object.
func (TaskDetails) IsNil ¶
func (s TaskDetails) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (*TaskDetails) MarshalJSONObject ¶
func (s *TaskDetails) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*TaskDetails) NKeys ¶
func (s *TaskDetails) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*TaskDetails) UnmarshalJSONObject ¶
func (s *TaskDetails) UnmarshalJSONObject(d *gojay.Decoder, k string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type TaskMeta ¶
type TaskMeta struct { // Database ID for the task record. Id uint64 // User provided name for the task. Name string }
TaskMeta represents a minimal representation of a task.
func (*TaskMeta) MarshalJSONObject ¶
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
type UserCreateRequest ¶
func (*UserCreateRequest) IsNil ¶
func (u *UserCreateRequest) IsNil() bool
func (*UserCreateRequest) MarshalJSONObject ¶
func (u *UserCreateRequest) MarshalJSONObject(e *gojay.Encoder)
func (*UserCreateRequest) NKeys ¶
func (u *UserCreateRequest) NKeys() int
func (*UserCreateRequest) UnmarshalJSONObject ¶
func (u *UserCreateRequest) UnmarshalJSONObject(d *gojay.Decoder, s string) error
type UserDetails ¶
type UserDetails struct { UserMeta Email string Providers UserList Supports UserList Created time.Time }
UserDetails defines the info available for a specific user record.
func (UserDetails) IsNil ¶
func (u UserDetails) IsNil() bool
IsNil implements the gojay MarshalerJSONObject interface.
func (UserDetails) MarshalJSONObject ¶
func (u UserDetails) MarshalJSONObject(e *gojay.Encoder)
MarshalJSONObject implements the gojay MarshalerJSONObject interface.
func (*UserDetails) NKeys ¶
func (u *UserDetails) NKeys() int
NKeys implements the gojay UnmarshalerJSONObject interface.
func (*UserDetails) UnmarshalJSONObject ¶
func (u *UserDetails) UnmarshalJSONObject(d *gojay.Decoder, s string) error
UnmarshalJSONObject implements the gojay UnmarshalerJSONObject interface.
type UserList ¶
type UserList []UserMeta
UserList is a list of user metadata for 0 or more users.
func (UserList) MarshalJSONArray ¶
type UserMeta ¶
type UserMeta struct { // Database ID for the user record. Id uint64 // User display name / nickname. DisplayName string }
UserMeta defines a base representation of a user record.
func (UserMeta) MarshalJSONObject ¶
MarshalJSONObject implements the gojay MarshalerJSONObject interface.