Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal improvements #56

Merged
merged 9 commits into from
May 20, 2019
Merged

Internal improvements #56

merged 9 commits into from
May 20, 2019

Conversation

Fs02
Copy link
Owner

@Fs02 Fs02 commented May 9, 2019

  • Cache some functions that use reflection.
  • Ability to avoid reflection on some cases by implementing inferfaces:
// Defines fields in a struct, used mainly in changeset.
type fields interface {
	Fields() map[string]int
}

// Defines type of fields in a struct, used mainly in changeset.
type types interface {
	fields
	Types() []reflect.Type
}

// Defines values of fields in a struct, used mainly in changeset.
type values interface {
	fields
	Values() []interface{}
}

// Defines database scanners, used when scanning result from database rows.
type scanners interface {
	Scanners([]string) []interface{}
}

@Fs02 Fs02 merged commit b2a13dd into master May 20, 2019
@Fs02 Fs02 deleted the internal-improvements branch May 20, 2019 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant