Versions in this module Expand all Collapse all v0 v0.6.0 Jun 30, 2023 Changes in this version + const DefaultMaxResultSize + var ErrNamespaceNotFound = errors.New("namespace not found") + type AssetModel struct + Changelog types.JSONText + CreatedAt time.Time + Data JSONMap + Description string + ID string + Labels JSONMap + Name string + NamespaceID string + Owners types.JSONText + Service string + Type string + URL string + URN string + UpdatedAt time.Time + UpdatedBy UserModel + Version string + type AssetProbeModel struct + AssetURN string + CreatedAt time.Time + ID string + Metadata JSONMap + Status string + StatusReason string + Timestamp time.Time + type AssetRepository struct + func NewAssetRepository(c *Client, userRepo *UserRepository, defaultGetMaxSize int, ...) (*AssetRepository, error) + func (r *AssetRepository) AddProbe(ctx context.Context, ns *namespace.Namespace, assetURN string, ...) error + func (r *AssetRepository) BuildFilterQuery(builder sq.SelectBuilder, flt asset.Filter) sq.SelectBuilder + func (r *AssetRepository) DeleteByID(ctx context.Context, id string) error + func (r *AssetRepository) DeleteByURN(ctx context.Context, urn string) error + func (r *AssetRepository) GetAll(ctx context.Context, flt asset.Filter) ([]asset.Asset, error) + func (r *AssetRepository) GetByID(ctx context.Context, id string) (asset.Asset, error) + func (r *AssetRepository) GetByURN(ctx context.Context, urn string) (asset.Asset, error) + func (r *AssetRepository) GetByVersionWithID(ctx context.Context, id string, version string) (asset.Asset, error) + func (r *AssetRepository) GetByVersionWithURN(ctx context.Context, urn string, version string) (asset.Asset, error) + func (r *AssetRepository) GetCount(ctx context.Context, flt asset.Filter) (total int, err error) + func (r *AssetRepository) GetProbes(ctx context.Context, assetURN string) ([]asset.Probe, error) + func (r *AssetRepository) GetProbesWithFilter(ctx context.Context, flt asset.ProbesFilter) (map[string][]asset.Probe, error) + func (r *AssetRepository) GetTypes(ctx context.Context, flt asset.Filter) (map[asset.Type]int, error) + func (r *AssetRepository) GetVersionHistory(ctx context.Context, flt asset.Filter, id string) (avs []asset.Asset, err error) + func (r *AssetRepository) Upsert(ctx context.Context, ns *namespace.Namespace, ast *asset.Asset) (string, error) + type Client struct + func NewClient(cfg Config) (*Client, error) + func (c *Client) Close() error + func (c *Client) ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) + func (c *Client) ExecQueries(ctx context.Context, queries []string) error + func (c *Client) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (c *Client) Migrate(cfg Config) (ver uint, err error) + func (c *Client) MigrateDown(cfg Config) (ver uint, err error) + func (c *Client) QueryFn(ctx context.Context, f func(*sqlx.Conn) error) error + func (c *Client) RunWithinTx(ctx context.Context, f func(tx *sqlx.Tx) error) error + func (c *Client) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + type Config struct + Host string + Name string + Password string + Port int + SSLMode string + User string + func (c *Config) ConnectionURL() *url.URL + type DiscussionModel struct + Assets pq.StringArray + Assignees pq.StringArray + Body string + CreatedAt time.Time + ID string + Labels pq.StringArray + NamespaceID string + Owner UserModel + State string + Title string + Type string + UpdatedAt time.Time + type DiscussionRepository struct + func NewDiscussionRepository(c *Client, defaultGetMaxSize int) (*DiscussionRepository, error) + func (r *DiscussionRepository) Create(ctx context.Context, ns *namespace.Namespace, dsc *discussion.Discussion) (string, error) + func (r *DiscussionRepository) CreateComment(ctx context.Context, ns *namespace.Namespace, cmt *discussion.Comment) (string, error) + func (r *DiscussionRepository) DeleteComment(ctx context.Context, cid string, did string) error + func (r *DiscussionRepository) Get(ctx context.Context, did string) (discussion.Discussion, error) + func (r *DiscussionRepository) GetAll(ctx context.Context, flt discussion.Filter) ([]discussion.Discussion, error) + func (r *DiscussionRepository) GetAllComments(ctx context.Context, did string, flt discussion.Filter) ([]discussion.Comment, error) + func (r *DiscussionRepository) GetComment(ctx context.Context, cid string, did string) (discussion.Comment, error) + func (r *DiscussionRepository) Patch(ctx context.Context, dsc *discussion.Discussion) error + func (r *DiscussionRepository) UpdateComment(ctx context.Context, cmt *discussion.Comment) error + type JSONMap map[string]interface + func (m *JSONMap) Scan(value interface{}) error + func (m *JSONMap) UnmarshalJSON(b []byte) error + func (m JSONMap) MarshalJSON() ([]byte, error) + func (m JSONMap) Value() (driver.Value, error) + type LineageEdgeModel struct + NamespaceID string + Prop JSONMap + Source string + Target string + type LineageGraphModel []LineageEdgeModel + type LineageRepository struct + func NewLineageRepository(client *Client) (*LineageRepository, error) + func (repo *LineageRepository) DeleteByURN(ctx context.Context, urn string) error + func (repo *LineageRepository) GetGraph(ctx context.Context, urn string, query asset.LineageQuery) (asset.LineageGraph, error) + func (repo *LineageRepository) Upsert(ctx context.Context, ns *namespace.Namespace, urn string, ...) error + type NamespaceModel struct + CreatedAt time.Time + DeletedAt *time.Time + ID uuid.UUID + Metadata JSONMap + Name string + State string + UpdatedAt time.Time + func BuildNamespaceModel(ns namespace.Namespace) (*NamespaceModel, error) + type NamespaceRepository struct + func NewNamespaceRepository(c *Client) *NamespaceRepository + func (n *NamespaceRepository) Create(ctx context.Context, ns *namespace.Namespace) (string, error) + func (n *NamespaceRepository) GetByID(ctx context.Context, uuid uuid.UUID) (*namespace.Namespace, error) + func (n *NamespaceRepository) GetByName(ctx context.Context, name string) (*namespace.Namespace, error) + func (n *NamespaceRepository) List(ctx context.Context) ([]*namespace.Namespace, error) + func (n *NamespaceRepository) Update(ctx context.Context, ns *namespace.Namespace) error + type StarClauses struct + Limit int + Offset int + SortDirectionKey string + SortKey string + type StarRepository struct + func NewStarRepository(c *Client) (*StarRepository, error) + func (r *StarRepository) Create(ctx context.Context, ns *namespace.Namespace, userID string, assetID string) (string, error) + func (r *StarRepository) Delete(ctx context.Context, userID string, assetID string) error + func (r *StarRepository) GetAllAssetsByUserID(ctx context.Context, flt star.Filter, userID string) ([]asset.Asset, error) + func (r *StarRepository) GetAssetByUserID(ctx context.Context, userID string, assetID string) (asset.Asset, error) + func (r *StarRepository) GetStargazers(ctx context.Context, flt star.Filter, assetID string) ([]user.User, error) + type TagJoinTemplateFieldModel struct + Field TagTemplateFieldModel + Template TagTemplateModel + type TagJoinTemplateFieldModels []TagJoinTemplateFieldModel + type TagJoinTemplateTagFieldModel struct + Field TagTemplateFieldModel + Tag TagModel + Template TagTemplateModel + type TagJoinTemplateTagFieldModels []TagJoinTemplateTagFieldModel + type TagModel struct + AssetID string + CreatedAt time.Time + Field TagTemplateFieldModel + FieldID uint + ID uint + NamespaceID string + UpdatedAt time.Time + Value string + type TagModels []TagModel + type TagRepository struct + func NewTagRepository(client *Client) (*TagRepository, error) + func (r *TagRepository) Create(ctx context.Context, ns *namespace.Namespace, domainTag *tag.Tag) error + func (r *TagRepository) Delete(ctx context.Context, domainTag tag.Tag) error + func (r *TagRepository) Read(ctx context.Context, filter tag.Tag) ([]tag.Tag, error) + func (r *TagRepository) Update(ctx context.Context, domainTag *tag.Tag) error + type TagTemplateFieldModel struct + CreatedAt time.Time + DataType string + Description string + DisplayName string + ID uint + NamespaceID uuid.UUID + Options *string + Required bool + Template TagTemplateModel + TemplateURN string + URN string + UpdatedAt time.Time + type TagTemplateFieldModels []TagTemplateFieldModel + type TagTemplateModel struct + CreatedAt time.Time + Description string + DisplayName string + Fields TagTemplateFieldModels + NamespaceID uuid.UUID + URN string + UpdatedAt time.Time + type TagTemplateModels []TagTemplateModel + type TagTemplateRepository struct + func NewTagTemplateRepository(c *Client) (*TagTemplateRepository, error) + func (r *TagTemplateRepository) Create(ctx context.Context, ns *namespace.Namespace, templateDomain *tag.Template) error + func (r *TagTemplateRepository) Delete(ctx context.Context, templateURN string) error + func (r *TagTemplateRepository) Read(ctx context.Context, templateURN string) ([]tag.Template, error) + func (r *TagTemplateRepository) ReadAll(ctx context.Context) ([]tag.Template, error) + func (r *TagTemplateRepository) Update(ctx context.Context, ns *namespace.Namespace, targetURN string, ...) error + type UserModel struct + CreatedAt sql.NullTime + Email sql.NullString + ID sql.NullString + NamespaceID string + Provider sql.NullString + UUID sql.NullString + UpdatedAt sql.NullTime + type UserModels []UserModel + type UserRepository struct + func NewUserRepository(c *Client) (*UserRepository, error) + func (r *UserRepository) Create(ctx context.Context, ns *namespace.Namespace, ud *user.User) (string, error) + func (r *UserRepository) CreateWithTx(ctx context.Context, tx *sqlx.Tx, ns *namespace.Namespace, ud *user.User) (string, error) + func (r *UserRepository) GetByEmail(ctx context.Context, email string) (user.User, error) + func (r *UserRepository) GetByUUID(ctx context.Context, uuid string) (user.User, error) + func (r *UserRepository) UpsertByEmail(ctx context.Context, ns *namespace.Namespace, ud *user.User) (string, error)