models

package
v0.0.0-...-fd508d4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package models is a generated protocol buffer package.

It is generated from these files:

user.proto

It has these top-level messages:

User

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUser   = fmt.Errorf("proto: integer overflow")
)

Functions

func RecycleErrResponse

func RecycleErrResponse(errResponse *ErrResponse)

RecycleErrResponse puts back ErrResponse struct back into sync pool

func RecycleMedia

func RecycleMedia(media *Media)

RecycleMedia puts back Media struct back into sync pool

func RecycleMediaList

func RecycleMediaList(mediaList *MediaList)

RecycleMediaList puts back MediaList struct back into sync pool

func RecycleSuccessResponse

func RecycleSuccessResponse(successResponse *SuccessResponse)

RecycleSuccessResponse puts back SuccessResponse struct back into sync pool

Types

type AppConfig

type AppConfig struct {
	Paths      []string // directories to load media from
	UserExpiry int      `toml:"user_expiry"`
}

AppConfig holds application-specific configurations

type CacheConfig

type CacheConfig struct {
	URI      string
	Password string
	Database string
}

CacheConfig holds redis cache configuration

type Config

type Config struct {
	Server   ServerConfig
	Database DatabaseConfig
	Cache    CacheConfig
	App      AppConfig
}

Config is configuration loaded from toml

type DatabaseConfig

type DatabaseConfig struct {
	URI    string
	DBName string
}

DatabaseConfig holds database-specific configurations

type ErrResponse

type ErrResponse struct {
	Msg  string
	Code int
}

ErrResponse is json response message for all server errors

func GetErrResponse

func GetErrResponse() *ErrResponse

GetErrResponse gets ErrResponse struct from sync pool

func (ErrResponse) MarshalEasyJSON

func (v ErrResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrResponse) MarshalJSON

func (v ErrResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ErrResponse) UnmarshalEasyJSON

func (v *ErrResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ErrResponse) UnmarshalJSON

func (v *ErrResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Media

type Media struct {
	Path      string    `json:"path" bson:"_id"`
	Category  string    `json:"category"`
	Subtitle  string    `json:"subtitle"`
	Name      string    `json:"name"`
	Mimetype  string    `json:"mimetype"`
	Extension string    `json:"extension"`
	Size      int64     `json:"size"`
	Access    []string  `json:"access,omitempty"`
	Added     time.Time `json:"added"`
}

Media -

func GetMedia

func GetMedia() *Media

GetMedia gets Media struct from sync pool

func (Media) MarshalEasyJSON

func (v Media) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Media) MarshalJSON

func (v Media) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Media) UnmarshalEasyJSON

func (v *Media) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Media) UnmarshalJSON

func (v *Media) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MediaList

type MediaList struct {
	Data  []Media
	Count int
}

MediaList -

func GetMediaList

func GetMediaList() *MediaList

GetMediaList gets MediaList struct from sync pool

func (MediaList) MarshalEasyJSON

func (v MediaList) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MediaList) MarshalJSON

func (v MediaList) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MediaList) UnmarshalEasyJSON

func (v *MediaList) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MediaList) UnmarshalJSON

func (v *MediaList) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ServerConfig

type ServerConfig struct {
	Port       int
	StaticPath string
}

ServerConfig holds server-specific configurations

type SuccessResponse

type SuccessResponse struct {
	Msg string
}

SuccessResponse is json response message for successful execution

func GetSuccessResponse

func GetSuccessResponse() *SuccessResponse

GetSuccessResponse gets SuccessResponse struct from sync pool

func (SuccessResponse) MarshalEasyJSON

func (v SuccessResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SuccessResponse) MarshalJSON

func (v SuccessResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SuccessResponse) UnmarshalEasyJSON

func (v *SuccessResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SuccessResponse) UnmarshalJSON

func (v *SuccessResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type User

type User struct {
	Email     string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty" bson:"_id"`
	FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	Hash      []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
}

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) Equal

func (this *User) Equal(that interface{}) bool

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetFirstName

func (m *User) GetFirstName() string

func (*User) GetHash

func (m *User) GetHash() []byte

func (*User) GetLastName

func (m *User) GetLastName() string

func (*User) GoString

func (this *User) GoString() string

func (*User) Marshal

func (m *User) Marshal() (dAtA []byte, err error)

func (*User) MarshalTo

func (m *User) MarshalTo(dAtA []byte) (int, error)

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) Size

func (m *User) Size() (n int)

func (*User) String

func (this *User) String() string

func (*User) Unmarshal

func (m *User) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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