model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ID         string
	Namespace  string
	Objects    []*Object
	Properties []*Property
}

func (*Configuration) FromProtobuf

func (c *Configuration) FromProtobuf(in *pb.Configuration) error

type Device

type Device struct {
	ID         string
	Status     string
	Properties []*Property
}

type LoginResponse

type LoginResponse struct {
	*Response
	AccessToken string `json:"access_token,omitempty"`
}

type Object

type Object struct {
	ID         string
	Name       string
	Type       string
	Objects    []*Object
	Properties []*Property
}

func (*Object) FromProtobuf

func (o *Object) FromProtobuf(in *pb.Object) error

type Permission

type Permission struct {
	ID   int64
	Name string
}

type Property

type Property struct {
	Key   string
	Value string
}

func (*Property) FromProtobuf

func (p *Property) FromProtobuf(in *pb.Property) error

type Response

type Response struct {
	Code  int    `json:"code"`
	Error string `json:"error,omitempty"`
}

type Role

type Role struct {
	ID        string
	Name      string
	CreatedAt string `db:"created_at"`
}

type User

type User struct {
	ID        string
	Email     string
	Password  string
	IPAddress string `db:"ip_address"`
	CreatedAt string `db:"created_at"`
	Roles     []*Role
}

func (*User) ComparePassword

func (user *User) ComparePassword(password string) bool

func (*User) HashedPassword

func (user *User) HashedPassword() error

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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