Documentation ¶
Index ¶
- type Message
- type MessageDB
- func (m *MessageDB) Add(ctx context.Context, model *Message) error
- func (m *MessageDB) DB() interface{}
- func (m *MessageDB) Delete(ctx context.Context, id int) error
- func (m *MessageDB) Get(ctx context.Context, id int) (*Message, error)
- func (m *MessageDB) List(ctx context.Context) ([]*Message, error)
- func (m *MessageDB) ListMessagetype(ctx context.Context) []*app.Messagetype
- func (m *MessageDB) OneMessagetype(ctx context.Context, id int) (*app.Messagetype, error)
- func (m *MessageDB) TableName() string
- func (m *MessageDB) Update(ctx context.Context, model *Message) error
- type MessageStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { ID int `gorm:"primary_key"` // primary key CreatedAt time.Time DeletedAt *time.Time Message string UpdatedAt time.Time }
Message model
func (*Message) MessageToMessagetype ¶
func (m *Message) MessageToMessagetype() *app.Messagetype
MessageToMessagetype loads a Message and builds the default view of media type Messagetype.
type MessageDB ¶
MessageDB is the implementation of the storage interface for Message.
func NewMessageDB ¶
NewMessageDB creates a new storage type.
func (*MessageDB) Get ¶
Get returns a single Message as a Database Model This is more for use internally, and probably not what you want in your controllers
func (*MessageDB) ListMessagetype ¶
func (m *MessageDB) ListMessagetype(ctx context.Context) []*app.Messagetype
ListMessagetype returns an array of view: default.
func (*MessageDB) OneMessagetype ¶
OneMessagetype loads a Message and builds the default view of media type Messagetype.
type MessageStorage ¶
type MessageStorage interface { DB() interface{} List(ctx context.Context) ([]*Message, error) Get(ctx context.Context, id int) (*Message, error) Add(ctx context.Context, message *Message) error Update(ctx context.Context, message *Message) error Delete(ctx context.Context, id int) error ListMessagetype(ctx context.Context) []*app.Messagetype OneMessagetype(ctx context.Context, id int) (*app.Messagetype, error) }
MessageStorage represents the storage interface.
Click to show internal directories.
Click to hide internal directories.