Skip to content
/ restutils Public

Utility functions for REST development in GO

Notifications You must be signed in to change notification settings

mhae/restutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple mapper function to convert between domain objects such as REST entity and a service layer. The Mapper function copies the values for exact field name matches between the source and destination structure.

Example:

type Source struct {
	SourceOnly string
	Common string
}

type Destination struct {
	DestinationOnly int
	Common string
}

s := &Source{"SourceOnly", "Common"}
d := &Destination{DestinationOnly:1}
Mapper(s, d)

Mapper copies the value of the field Common.

fmt.Println(d)
&{1 Common}

About

Utility functions for REST development in GO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages