ui/account.go
func (h *Handler) GetAccounts(tkn string) ([]data.Account, error) {
	logger := h.logger.Add("method", "GetAccounts")

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	accounts, err := h.selectAllFrom(logger, data.AccountTable, "")
	if err != nil {
		return nil, err
	}

	result := make([]data.Account, len(accounts))

	for k, v := range accounts {
		result[k] = *v.(*data.Account)
	}

	return result, nil
}
func (h *Handler) GetAccounts(tkn string) ([]data.Account, error) {
	logger := h.logger.Add("method", "GetAccounts")

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	accounts, err := h.selectAllFrom(logger, data.AccountTable, "")
	if err != nil {
		return nil, err
	}

	result := make([]data.Account, len(accounts))

	for k, v := range accounts {
		result[k] = *v.(*data.Account)
	}

	return result, nil
}
func ( h * Handler ) GetAccounts ( tkn string ) ( [ ] data . Account , error ) { logger := h . logger . Add ( " " , " " ) if ! h . token . Check ( tkn ) { logger . Warn ( " " ) return nil , ErrAccessDenied } accounts , err := h . selectAllFrom ( logger , data . AccountTable , " " ) if err != nil { return nil , err } result := make ( [ ] data . Account , len ( accounts ) ) for k , v := range accounts { result [ k ] = * v . ( * data . Account ) } return result , nil }
// GetAccounts returns accounts.
GetAccounts returns accounts .