domain

package
v0.0.0-...-c65d4cc Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MySQLUnavailable    = errors.New("mysql currently unavailable")
	RedisUnavailable    = errors.New("redis currently unavailable")
	RabbitMQUnavailable = errors.New("rabbitmq currently unavailable")
	RouteNotFound       = errors.New("route not found")
)

error text

View Source
var (
	ServiceAvailable  = "service is running well"
	MySQLAvailable    = "mysql is running well"
	RedisAvailable    = "redis is running well"
	RabbitMQAvailable = "rabbitmq is running well"
)

success text

Functions

This section is empty.

Types

type Example

type Example struct {
	ID        uint       `json:"id" gorm:"primary_key" sql:"index"`
	Name      string     `json:"name" binding:"required"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at" sql:"index"`
}

type ExampleMySQlRepositoryContract

type ExampleMySQlRepositoryContract interface {
	Fetch() ([]Example, error)
	Find(id int) (Example, error)
	Store(example *Example) error
	Update(example *Example) error
	Delete(example *Example) error
}

type ExampleServiceContract

type ExampleServiceContract interface {
	Fetch() ([]Example, error)
	Find(id int) (Example, error)
	Store(example *Example) error
	Update(example *Example) error
	Delete(id int) error
}

type RedisCacheContract

type RedisCacheContract interface {
	Set(ctx context.Context, key string, value interface{})
	Get(ctx context.Context, key string) *interface{}
	Delete(ctx context.Context, keys ...string)
	IsExist(ctx context.Context, key string) bool
	Expire(ctx context.Context, key string, expiration time.Duration)
}

Jump to

Keyboard shortcuts

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