28 lines
839 B
Go
28 lines
839 B
Go
|
package utils
|
||
|
|
||
|
import (
|
||
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models/graphModels"
|
||
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models/pgModels"
|
||
|
)
|
||
|
|
||
|
// GraphConvertSource converts a graphModels.AnthroveSource to a pgModels.Source
|
||
|
func GraphConvertSource(graphSource *graphModels.AnthroveSource) *pgModels.Source {
|
||
|
pgSource := &pgModels.Source{
|
||
|
DisplayName: graphSource.DisplayName,
|
||
|
Domain: graphSource.Domain,
|
||
|
Icon: graphSource.Icon,
|
||
|
}
|
||
|
return pgSource
|
||
|
}
|
||
|
|
||
|
// PostgresConvertToAnthroveSource converts a pgModels.Source to a graphModels.AnthroveSource
|
||
|
func PostgresConvertToAnthroveSource(pgSource *pgModels.Source) *graphModels.AnthroveSource {
|
||
|
graphSource := &graphModels.AnthroveSource{
|
||
|
DisplayName: pgSource.DisplayName,
|
||
|
Domain: pgSource.Domain,
|
||
|
Icon: pgSource.Icon,
|
||
|
}
|
||
|
|
||
|
return graphSource
|
||
|
}
|