Documentation ¶
Index ¶
- Variables
- type EsMessageRepo
- func (r *EsMessageRepo) Create(ctx context.Context, message NewMessage) (*Message, error)
- func (r *EsMessageRepo) Get(ctx context.Context, id string) (*Message, error)
- func (r *EsMessageRepo) List(ctx context.Context) ([]Message, error)
- func (r *EsMessageRepo) SetBase64(ctx context.Context, id string, data string) error
- func (r *EsMessageRepo) SetMd5(ctx context.Context, id string, data string) error
- func (r *EsMessageRepo) SetRot1(ctx context.Context, id string, data string) error
- func (r *EsMessageRepo) SetRot13(ctx context.Context, id string, data string) error
- type Message
- type MessageArgs
- type MessageCreate
- type MessageReads
- type MessageUpdate
- type NewMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Rot1 = "Rot1" Rot13 = "Rot13" Base64 = "Base64" Md5 = "Md5" AllCiphers = []string{Rot1, Rot13, Base64, Md5} )
View Source
var MessagesIndexName = "messages_and_their_ciphers"
Functions ¶
This section is empty.
Types ¶
type EsMessageRepo ¶
type EsMessageRepo struct {
Client *elasticsearch.Client
}
func (*EsMessageRepo) Create ¶
func (r *EsMessageRepo) Create(ctx context.Context, message NewMessage) (*Message, error)
type Message ¶
type Message struct { ID string `json:"id"` Plain string `json:"plain"` Rot1 *string `json:"rot_1,omitempty"` Rot13 *string `json:"rot_13,omitempty"` Base64 *string `json:"base_64,omitempty"` Md5 *string `json:"md_5,omitempty"` CreatedAt time.Time `json:"created_at"` ModifiedAt time.Time `json:"modified_at"` }
type MessageArgs ¶
type MessageArgs struct {
MessageId string `json:"message_id"`
}
func FromInterface ¶
func FromInterface(i interface{}) (*MessageArgs, error)
func (*MessageArgs) ToMap ¶
func (j *MessageArgs) ToMap() map[string]interface{}
type MessageCreate ¶
type MessageCreate interface {
Create(ctx context.Context, message NewMessage) (*Message, error)
}
type MessageReads ¶
type MessageUpdate ¶
type NewMessage ¶
type NewMessage struct {
Plain string `json:"plain"`
}
Click to show internal directories.
Click to hide internal directories.