api

package
v0.0.0-...-3390cab Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Register register router and start api server

Types

type File

type File struct {
	Name    string    `json:"name,omitempty"`
	IsDir   bool      `json:"is_dir,omitempty"`
	ModTime time.Time `json:"mod_time,omitempty"`
	Mode    string    `json:"mode,omitempty"`
}

File file struct

type FileResource

type FileResource struct {
}

FileResource is the REST layer to the File domain

func (FileResource) WebService

func (f FileResource) WebService() *restful.WebService

WebService creates a new service that can handle REST requests for File resources.

type User

type User struct {
	ID   string `json:"id" description:"identifier of the user"`
	Name string `json:"name" description:"name of the user" default:"john"`
	Age  int    `json:"age" description:"age of the user" default:"21"`
}

User is just a sample type

type UserResource

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

UserResource is the REST layer to the User domain

func (UserResource) WebService

func (u UserResource) WebService() *restful.WebService

WebService creates a new service that can handle REST requests for User resources.

Jump to

Keyboard shortcuts

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