models

package
v0.0.0-...-aeadec0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllMappingService = []MappingService{
	MappingServiceMetabase,
}

Functions

This section is empty.

Types

type Access

type Access struct {
	ID              uuid.UUID  `json:"id"`
	Subject         string     `json:"subject"`
	Granter         string     `json:"granter"`
	Expires         *time.Time `json:"expires"`
	Created         time.Time  `json:"created"`
	Revoked         *time.Time `json:"revoked"`
	DatasetID       uuid.UUID  `json:"datasetID"`
	AccessRequestID *uuid.UUID `json:"accessRequestID"`
}

type AccessRequest

type AccessRequest struct {
	ID          uuid.UUID           `json:"id"`
	DatasetID   uuid.UUID           `json:"datasetID"`
	Subject     string              `json:"subject"`
	SubjectType SubjectType         `json:"subjectType"`
	Created     time.Time           `json:"created"`
	Status      AccessRequestStatus `json:"status"`
	Closed      *time.Time          `json:"closed"`
	Expires     *time.Time          `json:"expires"`
	Granter     *string             `json:"granter"`
	Owner       string              `json:"owner"`
	Polly       *Polly              `json:"polly"`
	Reason      *string             `json:"reason"`
}

type AccessRequestStatus

type AccessRequestStatus string
const (
	AccessRequestStatusPending  AccessRequestStatus = "pending"
	AccessRequestStatusApproved AccessRequestStatus = "approved"
	AccessRequestStatusDenied   AccessRequestStatus = "denied"
)

func (AccessRequestStatus) IsValid

func (e AccessRequestStatus) IsValid() bool

func (AccessRequestStatus) MarshalGQL

func (e AccessRequestStatus) MarshalGQL(w io.Writer)

func (AccessRequestStatus) String

func (e AccessRequestStatus) String() string

func (*AccessRequestStatus) UnmarshalGQL

func (e *AccessRequestStatus) UnmarshalGQL(v interface{}) error

type AccessibleDatasets

type AccessibleDatasets struct {
	// owned
	Owned []*Dataset `json:"owned"`
	// granted
	Granted []*Dataset `json:"granted"`
}

type BigQuery

type BigQuery struct {
	ID            uuid.UUID
	DatasetID     uuid.UUID
	ProjectID     string       `json:"projectID"`
	Dataset       string       `json:"dataset"`
	Table         string       `json:"table"`
	TableType     BigQueryType `json:"tableType"`
	LastModified  time.Time    `json:"lastModified"`
	Created       time.Time    `json:"created"`
	Expires       *time.Time   `json:"expired"`
	Description   string       `json:"description"`
	PiiTags       *string      `json:"piiTags"`
	MissingSince  *time.Time   `json:"missingSince"`
	PseudoColumns []string     `json:"pseudoColumns"`
}

func (BigQuery) IsDatasource

func (BigQuery) IsDatasource()

type BigQuerySource

type BigQuerySource struct {
	// table is the name of the BigQuery table.
	Table string `json:"table"`
	// dataset is the name of the BigQuery dataset.
	Dataset string `json:"dataset"`
}

type BigQueryTable

type BigQueryTable struct {
	Description  string       `json:"description"`
	LastModified time.Time    `json:"lastModified"`
	Name         string       `json:"name"`
	Type         BigQueryType `json:"type"`
}

type BigQueryType

type BigQueryType string
const (
	BigQueryTypeTable            BigQueryType = "table"
	BigQueryTypeView             BigQueryType = "view"
	BigQueryTypeMaterializedView BigQueryType = "materialized_view"
)

func (BigQueryType) IsValid

func (e BigQueryType) IsValid() bool

func (BigQueryType) MarshalGQL

func (e BigQueryType) MarshalGQL(w io.Writer)

func (BigQueryType) String

func (e BigQueryType) String() string

func (*BigQueryType) UnmarshalGQL

func (e *BigQueryType) UnmarshalGQL(v interface{}) error

type BigqueryColumn

type BigqueryColumn struct {
	Name        string
	Type        string
	Mode        string
	Description string
}

type BigqueryMetadata

type BigqueryMetadata struct {
	Schema       BigquerySchema
	TableType    bigquery.TableType
	LastModified time.Time
	Created      time.Time
	Expires      time.Time
	Description  string
}

type BigquerySchema

type BigquerySchema struct {
	Columns []BigqueryColumn
}

type Dataproduct

type Dataproduct struct {
	ID           uuid.UUID `json:"id"`
	Name         string    `json:"name"`
	Created      time.Time `json:"created"`
	LastModified time.Time `json:"lastModified"`
	Description  *string   `json:"description"`
	Slug         string    `json:"slug"`
	Owner        *Owner    `json:"owner"`
}

func (Dataproduct) IsSearchResult

func (Dataproduct) IsSearchResult()

type Dataset

type Dataset struct {
	ID                       uuid.UUID `json:"id"`
	DataproductID            uuid.UUID `json:"dataproductID"`
	Name                     string    `json:"name"`
	Created                  time.Time `json:"created"`
	LastModified             time.Time `json:"lastModified"`
	Description              *string   `json:"description"`
	Slug                     string    `json:"slug"`
	Repo                     *string   `json:"repo"`
	Pii                      PiiLevel  `json:"pii"`
	Keywords                 []string  `json:"keywords"`
	Type                     gensql.DatasourceType
	AnonymisationDescription *string `json:"anonymisationDescription"`
	TargetUser               *string `json:"targetUser"`
}

func (Dataset) IsSearchResult

func (Dataset) IsSearchResult()

type DatasetServices

type DatasetServices struct {
	Metabase *string `json:"metabase"`
}

type Datasource

type Datasource interface {
	IsDatasource()
}

type GCPProject

type GCPProject struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Group *Group `json:"group"`
}

type Group

type Group struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type GroupStats

type GroupStats struct {
	Email        string `json:"email"`
	Dataproducts int    `json:"dataproducts"`
}

type InsightProduct

type InsightProduct struct {
	// id of the insight product.
	ID uuid.UUID `json:"id"`
	// name of the insight product.
	Name string `json:"name"`
	// creator of the insight product.
	Creator string `json:"creator"`
	// description of the insight product.
	Description string `json:"description"`
	// type of the insight product.
	Type string `json:"type"`
	// link to the insight product.
	Link string `json:"link"`
	// keywords for the insight product used as tags.
	Keywords []string `json:"keywords"`
	// group is the owner group of the insight product
	Group string `json:"group"`
	// teamkatalogenURL of the creator
	TeamkatalogenURL *string `json:"teamkatalogenURL,omitempty"`
	// Id of the creator's team.
	TeamID *string `json:"teamID,omitempty"`
	// created is the timestamp for when the insight product was created
	Created time.Time `json:"created"`
	// lastModified is the timestamp for when the insight product was last modified
	LastModified *time.Time `json:"lastModified,omitempty"`
}

InsightProduct contains the metadata of insight product.

type JoinableView

type JoinableView struct {
	// id is the id of the joinable view set
	ID      uuid.UUID  `json:"id"`
	Name    string     `json:"name"`
	Created time.Time  `json:"created"`
	Expires *time.Time `json:"expires"`
}

type JoinableViewDatasource

type JoinableViewDatasource struct {
	BigQueryUrl string `json:"bigqueryUrl"`
	Accessible  bool   `json:"accessible"`
	Deleted     bool   `json:"deleted"`
}

type JoinableViewWithDatasource

type JoinableViewWithDatasource struct {
	JoinableView
	PseudoDatasources []JoinableViewDatasource `json:"pseudoDatasources"`
}

type Keyword

type Keyword struct {
	Keyword string `json:"keyword"`
	Count   int    `json:"count"`
}

type MappingService

type MappingService string
const (
	MappingServiceMetabase MappingService = "metabase"
)

func (MappingService) IsValid

func (e MappingService) IsValid() bool

func (MappingService) MarshalGQL

func (e MappingService) MarshalGQL(w io.Writer)

func (MappingService) String

func (e MappingService) String() string

func (*MappingService) UnmarshalGQL

func (e *MappingService) UnmarshalGQL(v interface{}) error

type MetabaseMetadata

type MetabaseMetadata struct {
	DatasetID         uuid.UUID
	DatabaseID        int
	PermissionGroupID int
	CollectionID      int
	SAEmail           string
	DeletedAt         *time.Time
}

type Mutation

type Mutation struct {
}

type NadaToken

type NadaToken struct {
	// name of team
	Team string `json:"team"`
	// nada token for the team
	Token uuid.UUID `json:"token"`
}

NadaToken contains the token of the corresponding team

type NewAccessRequest

type NewAccessRequest struct {
	DatasetID   uuid.UUID    `json:"datasetID"`
	Subject     *string      `json:"subject"`
	SubjectType *SubjectType `json:"subjectType"`
	Owner       *string      `json:"owner"`
	Expires     *time.Time   `json:"expires"`
	Polly       *PollyInput  `json:"polly"`
}

type NewBigQuery

type NewBigQuery struct {
	ProjectID string  `json:"projectID"`
	Dataset   string  `json:"dataset"`
	Table     string  `json:"table"`
	PiiTags   *string `json:"piiTags"`
}

type NewDataproduct

type NewDataproduct struct {
	// name of dataproduct
	Name string `json:"name"`
	// description of the dataproduct
	Description *string `json:"description,omitempty"`
	// owner group email for the dataproduct.
	Group string `json:"group"`
	// owner Teamkatalogen URL for the dataproduct.
	TeamkatalogenURL *string `json:"teamkatalogenURL,omitempty"`
	// The contact information of the team who owns the dataproduct, which can be slack channel, slack account, email, and so on.
	TeamContact *string `json:"teamContact,omitempty"`
	// Id of the team's product area.
	ProductAreaID *string `json:"productAreaID,omitempty"`
	// Id of the team.
	TeamID *string `json:"teamID,omitempty"`
	Slug   *string
}

NewDataproduct contains metadata for creating a new dataproduct

type NewDataset

type NewDataset struct {
	DataproductID            uuid.UUID   `json:"dataproductID"`
	Name                     string      `json:"name"`
	Description              *string     `json:"description"`
	Slug                     *string     `json:"slug"`
	Repo                     *string     `json:"repo"`
	Pii                      PiiLevel    `json:"pii"`
	Keywords                 []string    `json:"keywords"`
	BigQuery                 NewBigQuery `json:"bigquery"`
	AnonymisationDescription *string     `json:"anonymisationDescription"`
	GrantAllUsers            *bool       `json:"grantAllUsers"`
	TargetUser               *string     `json:"targetUser"`
	Metadata                 BigqueryMetadata
	PseudoColumns            []string `json:"pseudoColumns"`
}

type NewDatasetForNewDataproduct

type NewDatasetForNewDataproduct struct {
	Name                     string      `json:"name"`
	Description              *string     `json:"description"`
	Repo                     *string     `json:"repo"`
	Pii                      PiiLevel    `json:"pii"`
	Keywords                 []string    `json:"keywords"`
	Bigquery                 NewBigQuery `json:"bigquery"`
	AnonymisationDescription *string     `json:"anonymisationDescription"`
	GrantAllUsers            *bool       `json:"grantAllUsers"`
	TargetUser               *string     `json:"targetUser"`
	Metadata                 BigqueryMetadata
}

NewDatasetForNewDataproduct contains metadata for creating a new dataset for a new dataproduct

type NewGrant

type NewGrant struct {
	DatasetID   uuid.UUID    `json:"datasetID"`
	Expires     *time.Time   `json:"expires"`
	Subject     *string      `json:"subject"`
	SubjectType *SubjectType `json:"subjectType"`
}

type NewInsightProduct

type NewInsightProduct struct {
	// name of the insight product.
	Name string `json:"name"`
	// description of the insight product.
	Description *string `json:"description,omitempty"`
	// type of the insight product.
	Type string `json:"type"`
	// link to the insight product.
	Link string `json:"link"`
	// keywords for the story used as tags.
	Keywords []string `json:"keywords"`
	// group is the owner group of the insight product
	Group string `json:"group"`
	// teamkatalogenURL of the creator
	TeamkatalogenURL *string `json:"teamkatalogenURL,omitempty"`
	// Id of the creator's product area.
	ProductAreaID *string `json:"productAreaID,omitempty"`
	// Id of the creator's team.
	TeamID *string `json:"teamID,omitempty"`
}

NewInsightProduct contains the metadata and content of insight products.

type NewJoinableViews

type NewJoinableViews struct {
	// Name is the name of the joinable views which will be used as the name of the dataset in bigquery, which contains all the joinable views
	Name    string     `json:"name"`
	Expires *time.Time `json:"expires"`
	// DatasetIDs is the IDs of the datasets which are made joinable.
	DatasetIDs []uuid.UUID `json:"datasetIDs"`
}

NewJoinableViews contains metadata for creating joinable views

type NewStory

type NewStory struct {
	// id of data story.
	ID *uuid.UUID `json:"id"`
	// name of the data story.
	Name string `json:"name"`
	// description of the data story.
	Description *string `json:"description"`
	// keywords for the story used as tags.
	Keywords []string `json:"keywords"`
	// teamkatalogenURL of the creator.
	TeamkatalogenURL *string `json:"teamkatalogenURL"`
	// Id of the creator's product area.
	ProductAreaID *string `json:"productAreaID"`
	// Id of the creator's team.
	TeamID *string `json:"teamID"`
	// group is the owner group of the data story.
	Group string `json:"group"`
}

NewStory contains the metadata and content of data stories.

type Owner

type Owner struct {
	Group            string  `json:"group"`
	TeamkatalogenURL *string `json:"teamkatalogenURL"`
	TeamContact      *string `json:"teamContact"`
	TeamID           *string `json:"teamID"`
}

type PiiLevel

type PiiLevel string
const (
	PiiLevelSensitive  PiiLevel = "sensitive"
	PiiLevelAnonymised PiiLevel = "anonymised"
	PiiLevelNone       PiiLevel = "none"
)

func (PiiLevel) IsValid

func (e PiiLevel) IsValid() bool

func (PiiLevel) MarshalGQL

func (e PiiLevel) MarshalGQL(w io.Writer)

func (PiiLevel) String

func (e PiiLevel) String() string

func (*PiiLevel) UnmarshalGQL

func (e *PiiLevel) UnmarshalGQL(v interface{}) error

type Polly

type Polly struct {
	ID uuid.UUID `json:"id"`
	QueryPolly
}

type PollyInput

type PollyInput struct {
	ID *uuid.UUID `json:"id"`
	QueryPolly
}

type ProductArea

type ProductArea struct {
	// id is the id of the product area.
	ID string `json:"id"`
	// name is the name of the product area.
	Name string `json:"name"`
	//areaType is the type of the product area.
	AreaType string `json:"areaType"`
}

type PseudoDataset

type PseudoDataset struct {
	// name is the name of the dataset
	Name string `json:"name"`
	// datasetID is the id of the dataset
	DatasetID uuid.UUID `json:"datasetID"`
	// datasourceID is the id of the bigquery datasource
	DatasourceID uuid.UUID `json:"datasourceID"`
}

PseudoDataset contains information about a pseudo dataset

type Query

type Query struct {
}

type QueryPolly

type QueryPolly struct {
	ExternalID string `json:"external_id"`
	Name       string `json:"name"`
	URL        string `json:"url"`
}

type SearchQuery

type SearchQuery struct {
	// Freetext search
	Text *string `json:"text"`
	// Filter on keyword
	Keywords []string `json:"keywords"`
	// Filter on group
	Groups []string `json:"groups"`
	//Filter on team_id
	TeamIDs []string `json:"teamIDs"`
	// Filter on enabled services
	Services []MappingService `json:"services"`
	// Filter on types
	Types []SearchType `json:"types"`

	Limit  *int `json:"limit"`
	Offset *int `json:"offset"`
}

type SearchQueryOld

type SearchQueryOld struct {
	// Freetext search
	Text *string `json:"text"`
	// Filter on keyword
	Keyword *string `json:"keyword"`
	// Filter on group
	Group *string `json:"group"`
	// Filter on teamID
	TeamID *string `json:"teamID"`
	Limit  *int    `json:"limit"`
	Offset *int    `json:"offset"`
}

type SearchResult

type SearchResult interface {
	IsSearchResult()
}

type SearchResultRow

type SearchResultRow struct {
	Excerpt string       `json:"excerpt"`
	Result  SearchResult `json:"result"`
	Rank    float64      `json:"rank"`
}

type SearchType

type SearchType string
const (
	SearchTypeDataproduct SearchType = "dataproduct"
	SearchTypeDataset     SearchType = "dataset"
	SearchTypeStory       SearchType = "story"
)

func (SearchType) IsValid

func (e SearchType) IsValid() bool

func (SearchType) MarshalGQL

func (e SearchType) MarshalGQL(w io.Writer)

func (SearchType) String

func (e SearchType) String() string

func (*SearchType) UnmarshalGQL

func (e *SearchType) UnmarshalGQL(v interface{}) error

type Session

type Session struct {
	Token       string
	AccessToken string
	Email       string `json:"preferred_username"`
	Name        string `json:"name"`
	Created     time.Time
	Expires     time.Time
}

type Story

type Story struct {
	// id of the data story.
	ID uuid.UUID `json:"id"`
	// name of the data story.
	Name string `json:"name"`
	// creator of the data story.
	Creator string `json:"creator"`
	// description of the data story.
	Description string `json:"description"`
	// keywords for the story used as tags.
	Keywords []string `json:"keywords"`
	// teamkatalogenURL of the creator.
	TeamkatalogenURL *string `json:"teamkatalogenURL"`
	// Id of the creator's team.
	TeamID *string `json:"teamID"`
	// created is the timestamp for when the data story was created.
	Created time.Time `json:"created"`
	// lastModified is the timestamp for when the dataproduct was last modified.
	LastModified *time.Time `json:"lastModified"`
	// group is the owner group of the data story.
	Group string `json:"group"`
}

Story contains the metadata and content of data stories.

func (Story) IsSearchResult

func (Story) IsSearchResult()

type SubjectType

type SubjectType string
const (
	SubjectTypeUser           SubjectType = "user"
	SubjectTypeGroup          SubjectType = "group"
	SubjectTypeServiceAccount SubjectType = "serviceAccount"
)

func StringToSubjectType

func StringToSubjectType(subjectType string) SubjectType

func (SubjectType) IsValid

func (e SubjectType) IsValid() bool

func (SubjectType) MarshalGQL

func (e SubjectType) MarshalGQL(w io.Writer)

func (SubjectType) String

func (e SubjectType) String() string

func (*SubjectType) UnmarshalGQL

func (e *SubjectType) UnmarshalGQL(v interface{}) error

type TableColumn

type TableColumn struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Mode        string `json:"mode"`
	Type        string `json:"type"`
}

type TableMetadata

type TableMetadata struct {
	ID     uuid.UUID     `json:"id"`
	Schema []TableColumn `json:"schema"`
}

type Team

type Team struct {
	// id is the team external id in teamkatalogen.
	ID string `json:"id"`
	// name is the name of the team.
	Name string `json:"name"`
	// productAreaID is the id of the product area.
	ProductAreaID string `json:"productAreaID"`
}

type UpdateAccessRequest

type UpdateAccessRequest struct {
	ID      uuid.UUID   `json:"id"`
	Owner   string      `json:"owner"`
	Expires *time.Time  `json:"expires"`
	Polly   *PollyInput `json:"polly"`
}

type UpdateDataproduct

type UpdateDataproduct struct {
	Name             string   `json:"name"`
	Description      *string  `json:"description"`
	Slug             *string  `json:"slug"`
	Pii              PiiLevel `json:"pii"`
	TeamkatalogenURL *string  `json:"teamkatalogenURL"`
	TeamContact      *string  `json:"teamContact"`
	ProductAreaID    *string  `json:"productAreaID"`
	TeamID           *string  `json:"teamID"`
}

type UpdateDataset

type UpdateDataset struct {
	Name                     string     `json:"name"`
	Description              *string    `json:"description"`
	Slug                     *string    `json:"slug"`
	Repo                     *string    `json:"repo"`
	Pii                      PiiLevel   `json:"pii"`
	Keywords                 []string   `json:"keywords"`
	DataproductID            *uuid.UUID `json:"dataproductID"`
	AnonymisationDescription *string    `json:"anonymisationDescription"`
	PiiTags                  *string    `json:"piiTags"`
	TargetUser               *string    `json:"targetUser"`
	PseudoColumns            []string   `json:"pseudoColumns"`
}

type UpdateKeywords

type UpdateKeywords struct {
	ObsoleteKeywords []string `json:"obsoleteKeywords"`
	ReplacedKeywords []string `json:"replacedKeywords"`
	NewText          []string `json:"newText"`
}

type UploadFile

type UploadFile struct {
	// path of the file uploaded
	Path string `json:"path"`
	// file data
	File graphql.Upload `json:"file"`
}

UploadFile contains path and data of a file

type UserInfo

type UserInfo struct {
	Name            string    `json:"name"`
	Email           string    `json:"email"`
	Groups          []*Group  `json:"groups"`
	LoginExpiration time.Time `json:"loginExpiration"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL