designaspect

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 2 Imported by: 0

README

designaspect

Install

$ go get -u github.com/akm/designaspect/...

LICENSE

MIT LICENSE

Documentation

Index

Constants

View Source
const Version = "0.1.2"

Variables

This section is empty.

Functions

func Service

func Service(name string, f ServiceFunc) *expr.ServiceExpr

Types

type AttributeElement

type AttributeElement interface {
	GetName() string
	IsRequired() bool
}

type Element

type Element interface {
	InService()
	InMethod()
	InPayload()
	InHTTP()
}

type ElementBase

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

func NewElementBase

func NewElementBase(inMethod, inPayload, inHTTP func()) *ElementBase

func (*ElementBase) InHTTP

func (el *ElementBase) InHTTP()

func (*ElementBase) InMethod

func (el *ElementBase) InMethod()

func (*ElementBase) InPayload

func (el *ElementBase) InPayload()

func (*ElementBase) InService

func (el *ElementBase) InService()

Service内で呼ばれた場合は InMethod を呼び出す

type Elements

type Elements []Element

func AppendElements

func AppendElements(elementsSlice ...Elements) Elements

func (Elements) InHTTP

func (s Elements) InHTTP()

func (Elements) InMethod

func (s Elements) InMethod()

func (Elements) InPayload

func (s Elements) InPayload()

func (Elements) InService

func (s Elements) InService()

func (Elements) RequiredNames

func (s Elements) RequiredNames() []string

type ElementsMap

type ElementsMap map[string]Elements

func ElementsMapWithMultiKeys

func ElementsMapWithMultiKeys(element Element, keys ...string) ElementsMap

func (ElementsMap) Merge

func (em ElementsMap) Merge(other ElementsMap) ElementsMap

type Method

type Method struct {
	Srvc     *Srvc
	Elements Elements
}

func (*Method) ElementsAll

func (m *Method) ElementsAll() Elements

func (*Method) HTTP

func (m *Method) HTTP(funcs ...func())

func (*Method) Payload

func (m *Method) Payload(args ...interface{})

func (*Method) Use

func (m *Method) Use(elements ...Element)

type MethodFunc

type MethodFunc func(*Method)

type NamedElement

type NamedElement struct {
	Name string

	*ElementBase
	// contains filtered or unexported fields
}

func NewNamedElement

func NewNamedElement(name string, inMethod, inPayload, inHTTP func(string)) *NamedElement

func (*NamedElement) Clone

func (el *NamedElement) Clone() *NamedElement

func (*NamedElement) GetName

func (el *NamedElement) GetName() string

func (*NamedElement) IsRequired

func (el *NamedElement) IsRequired() bool

func (*NamedElement) Optional

func (el *NamedElement) Optional() *NamedElement

func (*NamedElement) Required

func (el *NamedElement) Required() *NamedElement

func (*NamedElement) WithInHTTP

func (el *NamedElement) WithInHTTP(f func(name string)) *NamedElement

func (*NamedElement) WithInMethod

func (el *NamedElement) WithInMethod(f func(name string)) *NamedElement

func (*NamedElement) WithInPayload

func (el *NamedElement) WithInPayload(f func(name string)) *NamedElement

type Payload

type Payload struct {
	Method        *Method
	RequiredNames []string
}

func NewPayload

func NewPayload(method *Method) *Payload

func (*Payload) Attribute

func (p *Payload) Attribute(name string, args ...interface{}) string

func (*Payload) Done

func (p *Payload) Done()

func (*Payload) Field added in v0.1.5

func (p *Payload) Field(tag interface{}, name string, args ...interface{}) string

func (*Payload) Required

func (p *Payload) Required(names ...string)

type PayloadFunc

type PayloadFunc func(*Payload)

func FilterPayloadFunc added in v0.1.3

func FilterPayloadFunc(s []interface{}) ([]PayloadFunc, []interface{})

type ServiceFunc

type ServiceFunc func(*Srvc)

type Srvc

type Srvc struct {
	Elements Elements
}

func (*Srvc) HTTP

func (s *Srvc) HTTP(funcs ...func())

func (*Srvc) Method

func (s *Srvc) Method(name string, f MethodFunc)

func (*Srvc) Use

func (s *Srvc) Use(elements ...Element)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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