category

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "hub"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "1.0"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "category"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [1]string{"list"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeInternalError

func MakeInternalError(err error) *goa.ServiceError

MakeInternalError builds a goa.ServiceError from an error.

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "category".

Types

type Category

type Category struct {
	// ID is the unique id of the category
	ID uint
	// Name of category
	Name string
}

type Client

type Client struct {
	ListEndpoint goa.Endpoint
}

Client is the "category" service client.

func NewClient

func NewClient(list goa.Endpoint) *Client

NewClient initializes a "category" service client given the endpoints.

func (*Client) List

func (c *Client) List(ctx context.Context) (res *ListResult, err error)

List calls the "list" endpoint of the "category" service. List may return the following errors:

  • "internal-error" (type *goa.ServiceError): Internal Server Error
  • error: internal error

type Endpoints

type Endpoints struct {
	List goa.Endpoint
}

Endpoints wraps the "category" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "category" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "category" service endpoints.

type ListResult

type ListResult struct {
	Data []*Category
}

ListResult is the result type of the category service list method.

type Service

type Service interface {
	// List all categories along with their tags sorted by name
	List(context.Context) (res *ListResult, err error)
}

The category service provides details about category

Jump to

Keyboard shortcuts

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