users

package
v0.0.0-...-f38c46e Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package users @service users @title Users @description Users service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAsync

func AddAsync(ctx context.Context, param AddParam) (future futures.Future, err error)

func Component

func Component[C services.Component](ctx context.Context, name string) (component C, has bool)

func GetAsync

func GetAsync(ctx context.Context, param GetParam) (future futures.Future, err error)

func ListAsync

func ListAsync(ctx context.Context) (future futures.Future, err error)

func Service

func Service() (v services.Service)

Types

type AddParam

type AddParam struct {
	// Id
	// @title user id
	// @description user id
	Id string `json:"id" validate:"required" validate-message:""`
	// Name
	// @title name
	// @description name
	Name string `json:"name" validate:"required" validate-message:""`
	// Age
	// @title age
	// @description age
	Age int `json:"age"`
	// Birthday
	// @title birthday
	// @description birthday
	Birthday times.Time `json:"birthday"`
}

AddParam @title add param @description add user param

type GetParam

type GetParam struct {
	// Id
	// @title id
	// @description id
	// @validate-message-i18n >>>
	// zh: zh_message
	// en: en_message
	// <<<
	Id string `json:"id" validate:"not_blank" validate-message:"invalid_id"`
}

GetParam @title get param @description get param

func (GetParam) CacheKey

func (param GetParam) CacheKey(ctx context.Context) (key []byte, err error)

type User

type User struct {
	Id       string    `json:"id"`
	Name     string    `json:"name"`
	Age      string    `json:"age"`
	Birthday time.Time `json:"birthday"`
}

func Add

func Add(ctx context.Context, param AddParam) (result User, err error)

func Get

func Get(ctx context.Context, param GetParam) (result User, err error)

type Users

type Users []User

func List

func List(ctx context.Context) (result Users, err error)

Jump to

Keyboard shortcuts

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