catu

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: GPL-3.0 Imports: 39 Imported by: 12

README

Catu

Beware: In development!!!!!!!

Catupiri framework core module

usage

// Start the new app:
app := catu.NewApp()
// Register your plugins
app.RegisterPlugin("mm", mm.NewPlugin())
// Start the bootstrap process, will load all resources, bind routes, middlewares ...
app.Bootstrap()

// here you can use the app resources like run a command or start a server...

// Start the http server if required:
app.StartHTTPServer()

Core events

Powered by: https://github.com/gookit/event

  • configuration
  • bindMiddlewares
  • bindRoutes
  • setResponseFormats
  • bootstrap

Run tests:

go test ./...

Build with

  • Go
  • Time
  • Unknow things that some call magic

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SanitizerDefault *bluemonday.Policy

Functions

func BindMiddlewares added in v0.0.1

func BindMiddlewares(app App, p *Plugin)

BindMiddlewares - Bind middlewares in order

func CustomHTTPErrorHandler added in v0.0.1

func CustomHTTPErrorHandler(err error, c echo.Context)

func GetConfiguration added in v0.0.1

func GetConfiguration() configuration.ConfigurationInterface

func GetDefaultDatabaseConnection added in v0.0.1

func GetDefaultDatabaseConnection() *gorm.DB

func GetQueryInt64FromReq added in v0.0.1

func GetQueryInt64FromReq(param string, c echo.Context) int64

func GetQueryIntFromReq added in v0.0.1

func GetQueryIntFromReq(param string, c echo.Context) int

func GetSanitizer added in v0.0.1

func GetSanitizer() *bluemonday.Policy

func HealthCheckHandler added in v0.0.1

func HealthCheckHandler(c echo.Context) error

func InitSanitizer added in v0.0.1

func InitSanitizer()

Types

type App

type App interface {
	RegisterPlugin(p Pluginer)
	GetPlugins() map[string]Pluginer
	GetPlugin(name string) Pluginer
	SetPlugin(name string, plugin Pluginer) error

	GetRouter() *echo.Echo
	SetRouterGroup(name, path string) *echo.Group
	GetRouterGroup(name string) *echo.Group
	SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error
	StartHTTPServer() error
	NewRequestContext(opts *RequestContextOpts) *RequestContext
	// Get default app theme
	GetTheme() string
	// Set default app theme
	SetTheme(theme string) error
	// Get default app layout
	GetLayout() string
	// Set default app layout
	SetLayout(layout string) error
	GetTemplates() *template.Template
	LoadTemplates() error
	SetTemplateFunction(name string, f interface{})
	RenderTemplate(wr io.Writer, name string, data interface{}) error

	InitDatabase(name, engine string, isDefault bool) error
	SetModel(name string, f interface{})
	GetModel(name string) interface{}

	Can(permission string, userRoles []string) bool
	SetRole(name string, role acl.Role) error
	GetRoles() map[string]acl.Role
	GetRole(name string) *acl.Role
	SetRolePermission(name string, permission string, hasAccess bool) error
	GetRolePermission(name string, permission string) bool

	GetEvents() *event.Manager

	GetConfiguration() configuration.ConfigurationInterface

	GetDB() *gorm.DB
	SetDB(db *gorm.DB) error
	Migrate() error

	Bootstrap() error
	Close() error
}

func GetApp added in v0.0.1

func GetApp() App

func Init

func Init(options *AppOptions) App

type AppOptions added in v0.3.0

type AppOptions struct {
	// Gorm configurations / options
	GormOptions gorm.Option
}

type AppStruct added in v0.0.11

type AppStruct struct {
	InitTime time.Time

	Options *AppOptions

	Events *event.Manager

	Configuration configuration.ConfigurationInterface
	// Default database
	DB *gorm.DB
	// avaible databases
	DBs map[string]*gorm.DB

	Plugins map[string]Pluginer

	Models map[string]interface{}

	Resources map[string]*HTTPResource

	RolesString string
	RolesList   map[string]acl.Role
	// default theme for HTML responses
	Theme string
	// default layout for HTML responses
	Layout string
	// contains filtered or unexported fields
}

func (*AppStruct) Bootstrap added in v0.0.11

func (r *AppStruct) Bootstrap() error

func (*AppStruct) Can added in v0.0.11

func (r *AppStruct) Can(permission string, userRoles []string) bool

func (*AppStruct) Close added in v0.0.15

func (r *AppStruct) Close() error

Method for close and end all app operations, use that before close the app execution

func (*AppStruct) GetConfiguration added in v0.0.11

func (r *AppStruct) GetConfiguration() configuration.ConfigurationInterface

func (*AppStruct) GetDB added in v0.0.11

func (r *AppStruct) GetDB() *gorm.DB

func (*AppStruct) GetEvents added in v0.0.11

func (r *AppStruct) GetEvents() *event.Manager

func (*AppStruct) GetLayout added in v0.1.0

func (r *AppStruct) GetLayout() string

Get default app layout

func (*AppStruct) GetModel added in v0.0.11

func (r *AppStruct) GetModel(name string) interface{}

func (*AppStruct) GetPlugin added in v0.0.12

func (r *AppStruct) GetPlugin(name string) Pluginer

func (*AppStruct) GetPlugins added in v0.0.11

func (r *AppStruct) GetPlugins() map[string]Pluginer

func (*AppStruct) GetRole added in v0.3.4

func (r *AppStruct) GetRole(name string) *acl.Role

func (*AppStruct) GetRolePermission added in v0.3.4

func (r *AppStruct) GetRolePermission(name string, permission string) bool

func (*AppStruct) GetRoles added in v0.3.4

func (r *AppStruct) GetRoles() map[string]acl.Role

func (*AppStruct) GetRouter added in v0.0.11

func (r *AppStruct) GetRouter() *echo.Echo

func (*AppStruct) GetRouterGroup added in v0.0.11

func (r *AppStruct) GetRouterGroup(name string) *echo.Group

func (*AppStruct) GetTemplates added in v0.0.11

func (r *AppStruct) GetTemplates() *template.Template

func (*AppStruct) GetTheme added in v0.1.0

func (r *AppStruct) GetTheme() string

Get default app theme

func (*AppStruct) InitDatabase added in v0.0.11

func (r *AppStruct) InitDatabase(name, engine string, isDefault bool) error

func (*AppStruct) LoadTemplates added in v0.0.11

func (r *AppStruct) LoadTemplates() error

func (*AppStruct) Migrate added in v0.0.11

func (r *AppStruct) Migrate() error

Run migrations

func (*AppStruct) NewRequestContext added in v0.0.13

func (app *AppStruct) NewRequestContext(opts *RequestContextOpts) *RequestContext

func (*AppStruct) RegisterPlugin added in v0.0.11

func (r *AppStruct) RegisterPlugin(p Pluginer)

func (*AppStruct) RenderTemplate added in v0.0.16

func (app *AppStruct) RenderTemplate(wr io.Writer, name string, data interface{}) error

RenderTemplate - Render template with default app theme

func (*AppStruct) SetDB added in v0.0.11

func (r *AppStruct) SetDB(db *gorm.DB) error

func (*AppStruct) SetLayout added in v0.1.0

func (r *AppStruct) SetLayout(layout string) error

Set default app Layout

func (*AppStruct) SetModel added in v0.0.11

func (r *AppStruct) SetModel(name string, f interface{})

func (*AppStruct) SetPlugin added in v0.0.12

func (r *AppStruct) SetPlugin(name string, plugin Pluginer) error

func (*AppStruct) SetResource added in v0.0.11

func (r *AppStruct) SetResource(name string, httpController HTTPController, routerGroup *echo.Group) error

Set Resource CRUD. Now we only supports HTTP Resources / Ex Rest

func (*AppStruct) SetRole added in v0.3.4

func (r *AppStruct) SetRole(name string, role acl.Role) error

func (*AppStruct) SetRolePermission added in v0.3.4

func (r *AppStruct) SetRolePermission(name string, permission string, hasAccess bool) error

func (*AppStruct) SetRouterGroup added in v0.0.11

func (r *AppStruct) SetRouterGroup(name, path string) *echo.Group

func (*AppStruct) SetTemplateFunction added in v0.0.11

func (r *AppStruct) SetTemplateFunction(name string, f interface{})

func (*AppStruct) SetTheme added in v0.1.0

func (r *AppStruct) SetTheme(theme string) error

Set default app theme

func (*AppStruct) StartHTTPServer added in v0.0.11

func (r *AppStruct) StartHTTPServer() error

type BaseErrorResponse added in v0.0.1

type BaseErrorResponse struct {
	Messages []BaseErrorResponseMessage `json:"messages"`
}

type BaseErrorResponseMessage added in v0.0.1

type BaseErrorResponseMessage struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

type BaseListReponse added in v0.0.1

type BaseListReponse struct {
	Meta BaseMetaResponse `json:"meta"`
}

type BaseMetaResponse added in v0.0.1

type BaseMetaResponse struct {
	Count int64 `json:"count"`
}

type ContentDates added in v0.0.1

type ContentDates interface {
	GetTeaserDatesHTML(separator string) template.HTML
}

type CustomBinder added in v0.0.3

type CustomBinder struct{}

func (*CustomBinder) Bind added in v0.0.3

func (cb *CustomBinder) Bind(i interface{}, c echo.Context) (err error)

type HTTPController added in v0.0.6

type HTTPController interface {
	Query(c echo.Context) error
	Create(c echo.Context) error
	Count(c echo.Context) error
	FindOne(c echo.Context) error
	Update(c echo.Context) error
	Delete(c echo.Context) error
}

type HTTPError added in v0.0.4

type HTTPError struct {
	Code     int         `json:"code"`
	Message  interface{} `json:"message"`
	Internal error       `json:"-"` // Stores the error returned by an external dependency
}

HTTPError implements HTTP Error interface, default error object

func (*HTTPError) Error added in v0.2.0

func (e *HTTPError) Error() string

Error makes it compatible with `error` interface.

func (*HTTPError) GetCode added in v0.2.0

func (e *HTTPError) GetCode() int

func (*HTTPError) GetInternal added in v0.2.0

func (e *HTTPError) GetInternal() error

func (*HTTPError) GetMessage added in v0.2.0

func (e *HTTPError) GetMessage() interface{}

func (*HTTPError) SetCode added in v0.2.0

func (e *HTTPError) SetCode(code int) error

func (*HTTPError) SetInternal added in v0.2.0

func (e *HTTPError) SetInternal(internal error) error

func (*HTTPError) SetMessage added in v0.2.0

func (e *HTTPError) SetMessage(message interface{}) error

type HTTPErrorInterface added in v0.2.0

type HTTPErrorInterface interface {
	Error() string
	GetCode() int
	SetCode(code int) error
	GetMessage() interface{}
	SetMessage(message interface{}) error
}

type HTTPResource added in v0.0.6

type HTTPResource struct {
	Name       string
	Controller *HTTPController
}

type Plugin added in v0.0.1

type Plugin struct {
	Name string
}

func (*Plugin) BindMiddlewares added in v0.0.1

func (p *Plugin) BindMiddlewares(a App) error

func (*Plugin) GetName added in v0.0.1

func (p *Plugin) GetName() string

func (*Plugin) Init added in v0.0.1

func (p *Plugin) Init(a App) error

func (*Plugin) SetTemplateFuncMap added in v0.0.1

func (p *Plugin) SetTemplateFuncMap(app App) error

type PluginManager added in v0.0.1

type PluginManager interface {
	GetRouter(name string) *echo.Group
	SetRouter(name string) *echo.Group
	GetAPIRouter(name string) *echo.Group
}

type Pluginer added in v0.0.1

type Pluginer interface {
	Init(app App) error
	GetName() string
}

type RequestContext added in v0.0.6

type RequestContext struct {
	EchoContext echo.Context
	App         App

	Protocol  string
	Domain    string
	AppOrigin string
	Title     string

	IsAuthenticated   bool
	AuthenticatedUser UserInterface
	// authenticated user role name list
	Roles []string

	Session SessionData

	Widgets   map[string]map[string]string
	Theme     string
	Layout    string
	BodyClass []string
	Content   template.HTML
	Query     query_parser_to_db.QueryInterface
	Pager     *pagination.Pager

	ENV string
}

func NewRequestContext added in v0.0.6

func NewRequestContext(opts *RequestContextOpts) *RequestContext

func (*RequestContext) AddBodyClass added in v0.0.6

func (r *RequestContext) AddBodyClass(class string)

Add a body class string checking if is unique

func (*RequestContext) Attachment added in v0.0.11

func (c *RequestContext) Attachment(file string, name string) error

Attachment sends a response as attachment, prompting client to save the file.

func (*RequestContext) Bind added in v0.0.11

func (c *RequestContext) Bind(i interface{}) error

Bind binds the request body into provided type `i`. The default binder does it based on Content-Type header.

func (*RequestContext) Blob added in v0.0.11

func (c *RequestContext) Blob(code int, contentType string, b []byte) error

Blob sends a blob response with status code and content type.

func (*RequestContext) Can added in v0.0.6

func (r *RequestContext) Can(permission string) bool

func (*RequestContext) Cookie added in v0.0.11

func (c *RequestContext) Cookie(name string) (*http.Cookie, error)

Cookie returns the named cookie provided in the request.

func (*RequestContext) Cookies added in v0.0.11

func (c *RequestContext) Cookies() []*http.Cookie

Cookies returns the HTTP cookies sent with the request.

func (*RequestContext) Echo added in v0.0.11

func (c *RequestContext) Echo() *echo.Echo

Echo returns the `Echo` instance.

func (*RequestContext) Error added in v0.0.11

func (c *RequestContext) Error(err error)

Error invokes the registered HTTP error handler. Generally used by middleware.

func (*RequestContext) File added in v0.0.11

func (c *RequestContext) File(file string) error

File sends a response with the content of the file.

func (*RequestContext) FormFile added in v0.0.11

func (c *RequestContext) FormFile(name string) (*multipart.FileHeader, error)

FormFile returns the multipart form file for the provided name.

func (*RequestContext) FormParams added in v0.0.11

func (c *RequestContext) FormParams() (url.Values, error)

FormParams returns the form parameters as `url.Values`.

func (*RequestContext) FormValue added in v0.0.11

func (c *RequestContext) FormValue(name string) string

FormValue returns the form field value for the provided name.

func (*RequestContext) Get added in v0.0.6

func (r *RequestContext) Get(name string) interface{}

func (*RequestContext) GetAuthenticatedRoles added in v0.0.6

func (r *RequestContext) GetAuthenticatedRoles() *[]string

func (*RequestContext) GetBodyClassText added in v0.0.6

func (r *RequestContext) GetBodyClassText() string

Get body class as string,

func (*RequestContext) GetBool added in v0.0.6

func (r *RequestContext) GetBool(name string) bool

Get value from echo context data in boolean format

func (*RequestContext) GetLimit added in v0.0.6

func (r *RequestContext) GetLimit() int

func (*RequestContext) GetOffset added in v0.0.6

func (r *RequestContext) GetOffset() int

func (*RequestContext) GetResponseContentType added in v0.0.11

func (r *RequestContext) GetResponseContentType() string

Get selected response type

func (*RequestContext) GetString added in v0.0.6

func (r *RequestContext) GetString(name string) string

func (*RequestContext) GetStringMap added in v0.0.6

func (r *RequestContext) GetStringMap(name string) []string

Get data in string map format ([]string) from echo context data

func (*RequestContext) GetTemplateHTML added in v0.0.6

func (r *RequestContext) GetTemplateHTML(name string) template.HTML

func (*RequestContext) HTML added in v0.0.11

func (c *RequestContext) HTML(code int, html string) error

HTML sends an HTTP response with status code.

func (*RequestContext) HTMLBlob added in v0.0.11

func (c *RequestContext) HTMLBlob(code int, b []byte) error

HTMLBlob sends an HTTP blob response with status code.

func (*RequestContext) Handler added in v0.0.11

func (c *RequestContext) Handler() echo.HandlerFunc

Handler returns the matched handler by router.

func (*RequestContext) Inline added in v0.0.11

func (c *RequestContext) Inline(file string, name string) error

Inline sends a response as inline, opening the file in the browser.

func (*RequestContext) IsTLS added in v0.0.11

func (c *RequestContext) IsTLS() bool

IsTLS returns true if HTTP connection is TLS otherwise false.

func (*RequestContext) IsWebSocket added in v0.0.11

func (c *RequestContext) IsWebSocket() bool

IsWebSocket returns true if HTTP connection is WebSocket otherwise false.

func (*RequestContext) JSON added in v0.0.11

func (c *RequestContext) JSON(code int, i interface{}) error

JSON sends a JSON response with status code.

func (*RequestContext) JSONBlob added in v0.0.11

func (c *RequestContext) JSONBlob(code int, b []byte) error

JSONBlob sends a JSON blob response with status code.

func (*RequestContext) JSONP added in v0.0.11

func (c *RequestContext) JSONP(code int, callback string, i interface{}) error

JSONP sends a JSONP response with status code. It uses `callback` to construct the JSONP payload.

func (*RequestContext) JSONPBlob added in v0.0.11

func (c *RequestContext) JSONPBlob(code int, callback string, b []byte) error

JSONPBlob sends a JSONP blob response with status code. It uses `callback` to construct the JSONP payload.

func (*RequestContext) JSONPretty added in v0.0.11

func (c *RequestContext) JSONPretty(code int, i interface{}, indent string) error

JSONPretty sends a pretty-print JSON with status code.

func (*RequestContext) Logger added in v0.0.11

func (c *RequestContext) Logger() echo.Logger

Logger returns the `Logger` instance.

func (*RequestContext) MultipartForm added in v0.0.11

func (c *RequestContext) MultipartForm() (*multipart.Form, error)

MultipartForm returns the multipart form.

func (*RequestContext) NoContent added in v0.0.11

func (c *RequestContext) NoContent(code int) error

NoContent sends a response with no body and a status code.

func (*RequestContext) Param added in v0.0.11

func (c *RequestContext) Param(name string) string

Param returns path parameter by name.

func (*RequestContext) ParamNames added in v0.0.11

func (c *RequestContext) ParamNames() []string

ParamNames returns path parameter names.

func (*RequestContext) ParamValues added in v0.0.11

func (c *RequestContext) ParamValues() []string

ParamValues returns path parameter values.

func (*RequestContext) ParseQueryFromReq added in v0.0.6

func (r *RequestContext) ParseQueryFromReq(c echo.Context) error

func (*RequestContext) Partial added in v0.1.0

func (r *RequestContext) Partial(name string, data interface{}) template.HTML

Partial - Include and render one template inside other

func (*RequestContext) Path added in v0.0.11

func (c *RequestContext) Path() string

Path returns the registered path for the handler.

func (*RequestContext) QueryParam added in v0.0.11

func (c *RequestContext) QueryParam(name string) string

QueryParam returns the query param for the provided name.

func (*RequestContext) QueryParams added in v0.0.11

func (c *RequestContext) QueryParams() url.Values

QueryParams returns the query parameters as `url.Values`.

func (*RequestContext) QueryString added in v0.0.11

func (c *RequestContext) QueryString() string

QueryString returns the URL query string.

func (*RequestContext) RealIP added in v0.0.11

func (c *RequestContext) RealIP() string

RealIP returns the client's network address based on `X-Forwarded-For` or `X-Real-IP` request header. The behavior can be configured using `Echo#IPExtractor`.

func (*RequestContext) Redirect added in v0.0.11

func (c *RequestContext) Redirect(code int, url string) error

Redirect redirects the request to a provided URL with status code.

func (*RequestContext) RemoveBodyClass added in v0.0.6

func (r *RequestContext) RemoveBodyClass(class string)

Remove a body class string checking if is unique

func (*RequestContext) Render added in v0.0.6

func (c *RequestContext) Render(code int, name string, data interface{}) error

Render renders a template with data and sends a text/html response with status code. Renderer must be registered using `Echo.Renderer`.

func (*RequestContext) RenderPagination added in v0.0.6

func (r *RequestContext) RenderPagination(name string) string

func (*RequestContext) RenderTemplate added in v0.0.11

func (r *RequestContext) RenderTemplate(wr io.Writer, name string, data interface{}) error

Render one template, with support for themes

func (*RequestContext) Request added in v0.0.11

func (c *RequestContext) Request() *http.Request

Request returns `*http.Request`.

func (*RequestContext) Reset added in v0.0.11

func (c *RequestContext) Reset(r *http.Request, w http.ResponseWriter)

Reset resets the context after request completes. It must be called along with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. See `Echo#ServeHTTP()`

func (*RequestContext) Response added in v0.0.11

func (c *RequestContext) Response() *echo.Response

Response returns `*Response`.

func (*RequestContext) Scheme added in v0.0.11

func (c *RequestContext) Scheme() string

Scheme returns the HTTP protocol scheme, `http` or `https`.

func (*RequestContext) Set added in v0.0.6

func (r *RequestContext) Set(name string, value interface{})

func (*RequestContext) SetAuthenticatedUser added in v0.0.6

func (r *RequestContext) SetAuthenticatedUser(user UserInterface)

func (*RequestContext) SetAuthenticatedUserAndFillRoles added in v0.0.6

func (r *RequestContext) SetAuthenticatedUserAndFillRoles(user UserInterface)

func (*RequestContext) SetCookie added in v0.0.11

func (c *RequestContext) SetCookie(cookie *http.Cookie)

SetCookie adds a `Set-Cookie` header in HTTP response.

func (*RequestContext) SetHandler added in v0.0.11

func (c *RequestContext) SetHandler(h echo.HandlerFunc)

SetHandler sets the matched handler by router.

func (*RequestContext) SetLogger added in v0.0.11

func (c *RequestContext) SetLogger(l echo.Logger)

Set the logger

func (*RequestContext) SetParamNames added in v0.0.11

func (c *RequestContext) SetParamNames(names ...string)

SetParamNames sets path parameter names.

func (*RequestContext) SetParamValues added in v0.0.11

func (c *RequestContext) SetParamValues(values ...string)

SetParamValues sets path parameter values.

func (*RequestContext) SetPath added in v0.0.11

func (c *RequestContext) SetPath(p string)

SetPath sets the registered path for the handler.

func (*RequestContext) SetRequest added in v0.0.11

func (c *RequestContext) SetRequest(r *http.Request)

SetRequest sets `*http.Request`.

func (*RequestContext) SetResponse added in v0.0.11

func (c *RequestContext) SetResponse(r *echo.Response)

SetResponse sets `*Response`.

func (*RequestContext) SetResponseContentType added in v0.0.11

func (r *RequestContext) SetResponseContentType(v string) error

Set response type, returns error if the type is invalid TODO! add type validation

func (*RequestContext) Stream added in v0.0.11

func (c *RequestContext) Stream(code int, contentType string, r io.Reader) error

Stream sends a streaming response with status code and content type.

func (*RequestContext) String added in v0.0.11

func (c *RequestContext) String(code int, s string) error

String sends a string response with status code.

func (*RequestContext) Validate added in v0.0.11

func (c *RequestContext) Validate(i interface{}) error

Validate validates provided `i`. It is usually called after `Context#Bind()`. Validator must be registered using `Echo#Validator`.

func (*RequestContext) XML added in v0.0.11

func (c *RequestContext) XML(code int, i interface{}) error

XML sends an XML response with status code.

func (*RequestContext) XMLBlob added in v0.0.11

func (c *RequestContext) XMLBlob(code int, b []byte) error

XMLBlob sends an XML blob response with status code.

func (*RequestContext) XMLPretty added in v0.0.11

func (c *RequestContext) XMLPretty(code int, i interface{}, indent string) error

XMLPretty sends a pretty-print XML with status code.

type RequestContextOpts added in v0.0.11

type RequestContextOpts struct {
	EchoContext echo.Context
}

type SessionData added in v0.0.1

type SessionData struct {
	UserID string
}

type TemplateCTX added in v0.0.1

type TemplateCTX struct {
	EchoContext echo.Context
	Ctx         interface{}
	Record      interface{}
	Records     interface{}
}

type TemplateRenderer added in v0.0.1

type TemplateRenderer struct {
	// contains filtered or unexported fields
}

func (*TemplateRenderer) Render added in v0.0.1

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

type UserInterface added in v0.0.1

type UserInterface interface {
	// getters:
	GetID() string
	SetID(id string) error
	GetRoles() []string
	SetRoles(v []string) error
	AddRole(role string) error
	RemoveRole(role string) error
	GetEmail() string
	SetEmail(v string) error
	GetUsername() string
	SetUsername(v string) error
	GetDisplayName() string
	SetDisplayName(v string) error
	GetFullName() string
	SetFullName(v string) error
	GetLanguage() string
	SetLanguage(v string) error
	IsActive() bool
	SetActive(blocked bool) error
	IsBlocked() bool
	SetBlocked(blocked bool) error
	// FillById
	FillById(ID string) error
}

type ValidationFieldError added in v0.0.3

type ValidationFieldError struct {
	Field   string `json:"field"`
	Tag     string `json:"tag"`
	Value   string `json:"value"`
	Message string `json:"message"`
}

type ValidationResponse added in v0.0.3

type ValidationResponse struct {
	Errors []*ValidationFieldError `json:"errors"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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