Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

125 Commits
125 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Procyon Core

Go Report Card codecov Build Status Gitter PkgGoDev

This gives you a basic understanding of Procyon Core Module.

Components

All instances managed by the framework such as Controller, Initializers and Processors are considered as a component.

Register Component

It's used to register the components. However, you can pass only a construction-function into it. Construction function means a function returning only one type but it can have multiple parameters.

func Register(components ...Component)

The example is given below.

type MyComponent struct {

}

func NewMyComponent() MyComponent {
    return MyComponent{}
}

func init() {
    core.Register(NewMyComponent) 
}

Component Processor

This allows you to process the components registered before application starts.

type ComponentProcessor interface {
	SupportsComponent(typ goo.Type) bool
	ProcessComponent(typ goo.Type) error
}
  • SupportsComponent if it returns true, it means that the component will be processed by this component processor.
  • ProcessComponent If the method SupportComponent returns true, it will be invoked.

The example of a custom component processor is given below.

type CustomComponentProcessor struct {
}

func NewCustomComponentProcessor() CustomComponentProcessor {
	return CustomComponentProcessor{}
}

func (processor CustomComponentProcessor) SupportsComponent(typ goo.Type) bool {
	// do whatever you want
    return false
}

func (processor CustomComponentProcessor) ProcessComponent(typ goo.Type) error {
	// do whatever you want
    return nil
}

Note that you need to register the component processors by using the function core.Register.

License

Procyon Framework is released under version 2.0 of the Apache License

About

It provides essential infrastructures and utilities for Procyon Framework

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.