Documentation ¶
Index ¶
- Variables
- func EncodeString(s string) string
- func Exists(file string) bool
- func GetEnv() string
- func ReadFile(file string, obj interface{}) ([]byte, error)
- func ReadFileLines(file string) ([]string, error)
- func WriteFile(file string, obj interface{}) error
- type AppConfig
- type Content
- type ContentList
- type Controller
- func (c *Controller) GetSectionContentsHandler(ctx *web.Context) error
- func (c *Controller) GetSectionHandler(ctx *web.Context) error
- func (c *Controller) GetSectionsContentsHandler(ctx *web.Context) error
- func (c *Controller) GetSectionsHandler(ctx *web.Context) error
- func (c *Controller) RegisterRoutes(w manager.IWeb) error
- type ErrorResponse
- type GetSectionContentsRequest
- type GetSectionRequest
- type IStorageDB
- type Interactor
- func (i *Interactor) GetSection(request *GetSectionRequest) (*Section, error)
- func (i *Interactor) GetSectionContents(request *GetSectionContentsRequest) (*SectionContents, error)
- func (i *Interactor) GetSections() (SectionList, error)
- func (i *Interactor) GetSectionsContents() (SectionsContentsList, error)
- type Profile
- type ProfileConfig
- type ProfileOption
- type Section
- type SectionContents
- type SectionList
- type SectionsContentsList
- type StoragePostgres
- func (storage *StoragePostgres) GetSection(sectionKey string) (*Section, error)
- func (storage *StoragePostgres) GetSectionContents(sectionKey string) (*SectionContents, error)
- func (storage *StoragePostgres) GetSections() (SectionList, error)
- func (storage *StoragePostgres) GetSectionsContents() (SectionsContentsList, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorNotFound = errors.New(errors.LevelError, int(web.StatusNotFound), "user not found") ErrorInvalidType = errors.New(errors.LevelError, int(web.StatusNotFound), "invalid type") )
Functions ¶
func EncodeString ¶
func ReadFileLines ¶
Types ¶
type Content ¶
type Content struct { IdContent string `json:"id_content" db:"id_content"` Key string `json:"key" db:"key"` Type string `json:"type" db:"type"` Content *json.RawMessage `json:"content" db:"content"` }
type ContentList ¶
type ContentList []*Content
func (*ContentList) Scan ¶
func (l *ContentList) Scan(src interface{}) error
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(config *ProfileConfig, interactor *Interactor) *Controller
func (*Controller) GetSectionContentsHandler ¶
func (c *Controller) GetSectionContentsHandler(ctx *web.Context) error
func (*Controller) GetSectionHandler ¶
func (c *Controller) GetSectionHandler(ctx *web.Context) error
func (*Controller) GetSectionsContentsHandler ¶
func (c *Controller) GetSectionsContentsHandler(ctx *web.Context) error
func (*Controller) GetSectionsHandler ¶
func (c *Controller) GetSectionsHandler(ctx *web.Context) error
func (*Controller) RegisterRoutes ¶
func (c *Controller) RegisterRoutes(w manager.IWeb) error
type ErrorResponse ¶
type GetSectionContentsRequest ¶
type GetSectionContentsRequest struct {
SectionKey string `json:"section_key" validate:"notzero"`
}
type GetSectionRequest ¶
type GetSectionRequest struct {
SectionKey string `json:"section_key" validate:"notzero"`
}
type IStorageDB ¶
type IStorageDB interface { GetSections() (SectionList, error) GetSectionsContents() (SectionsContentsList, error) GetSection(sectionKey string) (*Section, error) GetSectionContents(sectionKey string) (*SectionContents, error) }
type Interactor ¶
type Interactor struct {
// contains filtered or unexported fields
}
func NewInteractor ¶
func NewInteractor(logger logger.ILogger, storageDB IStorageDB) *Interactor
func (*Interactor) GetSection ¶
func (i *Interactor) GetSection(request *GetSectionRequest) (*Section, error)
func (*Interactor) GetSectionContents ¶
func (i *Interactor) GetSectionContents(request *GetSectionContentsRequest) (*SectionContents, error)
func (*Interactor) GetSections ¶
func (i *Interactor) GetSections() (SectionList, error)
func (*Interactor) GetSectionsContents ¶
func (i *Interactor) GetSectionsContents() (SectionsContentsList, error)
type Profile ¶
type Profile struct {
// contains filtered or unexported fields
}
func (*Profile) Reconfigure ¶
func (profile *Profile) Reconfigure(options ...ProfileOption)
Reconfigure ...
type ProfileConfig ¶
type ProfileConfig struct { Host string `json:"host"` Dbr *dbr.DbrConfig `json:"dbr"` Migration *migration.MigrationConfig `json:"migration"` Log struct { Level string `json:"level"` } `json:"log"` }
ProfileConfig ...
type ProfileOption ¶
type ProfileOption func(profile *Profile)
ProfileOption ...
func WithConfiguration ¶
func WithConfiguration(config *ProfileConfig) ProfileOption
WithConfiguration ...
type SectionContents ¶
type SectionContents struct { Section Contents ContentList `json:"contents" db:"contents"` }
type SectionList ¶
type SectionList []*Section
type SectionsContentsList ¶
type SectionsContentsList []*SectionContents
type StoragePostgres ¶
type StoragePostgres struct {
// contains filtered or unexported fields
}
func NewStoragePostgres ¶
func NewStoragePostgres(config *ProfileConfig) (*StoragePostgres, error)
func (*StoragePostgres) GetSection ¶
func (storage *StoragePostgres) GetSection(sectionKey string) (*Section, error)
func (*StoragePostgres) GetSectionContents ¶
func (storage *StoragePostgres) GetSectionContents(sectionKey string) (*SectionContents, error)
func (*StoragePostgres) GetSections ¶
func (storage *StoragePostgres) GetSections() (SectionList, error)
func (*StoragePostgres) GetSectionsContents ¶
func (storage *StoragePostgres) GetSectionsContents() (SectionsContentsList, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.