winter

package
v0.0.0-...-2a3249f Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package apis for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package interfaces for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package apis for common apis MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package apis for common interfaces MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Helper manage beans
	Helper = (&Manager{}).New("manager")
)

Functions

This section is empty.

Types

type Bean

type Bean struct {
	Name string
}

Bean interface

func (*Bean) GetName

func (bean *Bean) GetName() string

GetName get the bean name

func (*Bean) Inject

func (bean *Bean) Inject(string, map[string]IBean) error

Inject Init this bean

func (*Bean) PostConstruct

func (bean *Bean) PostConstruct(string) error

PostConstruct Init this bean

func (*Bean) SetName

func (bean *Bean) SetName(name string)

SetName fix the bean name

func (*Bean) Validate

func (bean *Bean) Validate(string) error

Validate Init this bean

type IBean

type IBean interface {
	Init() error
	GetName() string
	SetName(name string)
	PostConstruct(string) error
	Validate(string) error
}

IBean interface

type IManager

type IManager interface {
	IService
	// Method
	Register(name string, b IBean) error
	Boot(PackManager, string) error
	GetBean(name string) interface{}
	GetBeanNames() []string
	ForEach(func(interface{}))
}

IManager interface

type IService

type IService interface {
	IBean
}

IService all package methods

type Manager

type Manager struct {
	*Service
	// Bean registry
	ArrayOfBeans     []interface{}
	ArrayOfBeanNames []string
	// Bean registry
	MapOfBeans map[string]interface{}
}

Manager interface

func (*Manager) Boot

func (m *Manager) Boot(box PackManager, notFound string) error

Boot Init this manager

func (*Manager) ForEach

func (m *Manager) ForEach(iter func(interface{}))

ForEach interate on beans

func (*Manager) GetBean

func (m *Manager) GetBean(name string) interface{}

GetBean get bean

func (*Manager) GetBeanNames

func (m *Manager) GetBeanNames() []string

GetBeanNames get bean

func (*Manager) Init

func (m *Manager) Init() error

Init a single bean

func (*Manager) Inject

func (m *Manager) Inject(name string, intf interface{}) error

Inject this API

func (*Manager) New

func (m *Manager) New(name string) IManager

New constructor

func (*Manager) Register

func (m *Manager) Register(name string, b IBean) error

Register a single bean

type PackManager

type PackManager interface {
	List() []string
	MustString(string) (string, error)
}

PackManager implements packager

type Service

type Service struct {
	// members
	*Bean
}

Service base class

func (*Service) Init

func (p *Service) Init() error

Init initialize the APIf

func (*Service) PostConstruct

func (p *Service) PostConstruct(name string) error

PostConstruct this API

func (*Service) Validate

func (p *Service) Validate(name string) error

Validate Init this bean

Jump to

Keyboard shortcuts

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