definition

package
v1.5.9-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceDescriperBuild

func ServiceDescriperBuild(serviceName string, group string, version string) string

ServiceDescriperBuild: build the service key, format is `group/serviceName:version` which be same as URL's service key

Types

type FullServiceDefinition

type FullServiceDefinition struct {
	ServiceDefinition
	Params map[string]string
}

FullServiceDefinition is the describer of service definition with parameters

type MethodDefinition

type MethodDefinition struct {
	Name           string
	ParameterTypes []string
	ReturnType     string
	Parameters     []TypeDefinition
}

MethodDefinition is the describer of method definition

type ServiceDefiner

type ServiceDefiner interface {
	ToBytes() ([]byte, error)
}

ServiceDefiner is a interface of service's definition

type ServiceDefinition

type ServiceDefinition struct {
	CanonicalName string
	CodeSource    string
	Methods       []MethodDefinition
	Types         []TypeDefinition
}

ServiceDefinition is the describer of service definition

func BuildServiceDefinition

func BuildServiceDefinition(service common.Service, url *common.URL) *ServiceDefinition

BuildServiceDefinition can build service definition which will be used to describe a service

func (*ServiceDefinition) String

func (def *ServiceDefinition) String() string

String will iterate all methods and parameters and convert them to json string

func (*ServiceDefinition) ToBytes

func (def *ServiceDefinition) ToBytes() ([]byte, error)

ToBytes convert ServiceDefinition to json string

type TypeDefinition

type TypeDefinition struct {
	Id              string
	Type            string
	Items           []TypeDefinition
	Enums           []string
	Properties      map[string]TypeDefinition
	TypeBuilderName string
}

TypeDefinition is the describer of type definition

type User

type User struct {
	Id   string
	Name string
	Age  int32
	Time time.Time
}

func (User) JavaClassName

func (u User) JavaClassName() string

type UserProvider

type UserProvider struct {
}

func (*UserProvider) GetUser

func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error)

func (*UserProvider) Reference

func (u *UserProvider) Reference() string

Jump to

Keyboard shortcuts

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