tk

package
v0.0.0-...-5597880 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tk provides a client for the team catalog API. - https://teamkatalog-api.intern.nav.no/swagger-ui/index.html

Index

Constants

View Source
const (
	ConsumerIDHeader = "Nav-Consumer-Id"
	ConsumerID       = "nada-backend"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(apiURL string, client *http.Client) *Client

func (*Client) GetProductAreas

func (c *Client) GetProductAreas(ctx context.Context) (*ProductAreas, error)

func (*Client) GetTeam

func (c *Client) GetTeam(ctx context.Context, teamID uuid.UUID) (*Team, error)

func (*Client) GetTeamCatalogURL

func (c *Client) GetTeamCatalogURL(teamID uuid.UUID) string

func (*Client) GetTeams

func (c *Client) GetTeams(ctx context.Context) (*Teams, error)

func (*Client) GetTeamsInProductArea

func (c *Client) GetTeamsInProductArea(ctx context.Context, productAreaID uuid.UUID) (*Teams, error)

type Fetcher

type Fetcher interface {
	GetProductAreas(ctx context.Context) (*ProductAreas, error)
	GetTeams(ctx context.Context) (*Teams, error)
	GetTeam(ctx context.Context, teamID uuid.UUID) (*Team, error)
	GetTeamsInProductArea(ctx context.Context, productAreaID uuid.UUID) (*Teams, error)
	GetTeamCatalogURL(teamID uuid.UUID) string
}
type Links struct {
	UI string `json:"ui"`
}

type ProductArea

type ProductArea struct {
	ID       uuid.UUID `json:"id"`
	Name     string    `json:"name"`
	AreaType string    `json:"areaType"`
}

type ProductAreas

type ProductAreas struct {
	Content []ProductArea `json:"content"`
}

type Static

type Static struct {
	ProductAreas map[uuid.UUID]*ProductArea
	Teams        map[uuid.UUID]*Team
	// contains filtered or unexported fields
}

func NewStatic

func NewStatic(apiURL string, productAreas []*ProductArea, teams []*Team) *Static

func (*Static) GetProductAreas

func (s *Static) GetProductAreas(_ context.Context) (*ProductAreas, error)

func (*Static) GetTeam

func (s *Static) GetTeam(_ context.Context, teamID uuid.UUID) (*Team, error)

func (*Static) GetTeamCatalogURL

func (s *Static) GetTeamCatalogURL(teamID uuid.UUID) string

func (*Static) GetTeams

func (s *Static) GetTeams(_ context.Context) (*Teams, error)

func (*Static) GetTeamsInProductArea

func (s *Static) GetTeamsInProductArea(_ context.Context, productAreaID uuid.UUID) (*Teams, error)

type Team

type Team struct {
	ID            uuid.UUID `json:"id"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	Links         Links     `json:"links"`
	NaisTeams     []string  `json:"naisTeams"`
	ProductAreaID uuid.UUID `json:"productAreaId"`
}

type Teams

type Teams struct {
	Content []Team `json:"content"`
}

Jump to

Keyboard shortcuts

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