This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
otter-space-sdk/internal/utils/modelConvert.go

28 lines
839 B
Go
Raw Normal View History

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
}