avg

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterController

func RegisterController(v0 *server.V0, c *Controller)

Types

type Asset added in v0.7.0

type Asset struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
}

type Avg added in v0.7.0

type Avg []Group

type Controller

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

func NewController

func NewController(service *Service) *Controller

func (*Controller) GetGroupByID

func (c *Controller) GetGroupByID(ctx *fiber.Ctx) error

func (*Controller) GetGroups

func (c *Controller) GetGroups(ctx *fiber.Ctx) error

func (*Controller) GetStories

func (c *Controller) GetStories(ctx *fiber.Ctx) error

func (*Controller) GetStoryByID

func (c *Controller) GetStoryByID(ctx *fiber.Ctx) error

type Group

type Group struct {
	ID      string  `json:"id"`
	Name    string  `json:"name"`
	Type    string  `json:"type"`
	Stories []Story `json:"stories"`
}

type Repo added in v0.10.0

type Repo struct {
	bun.IDB
	DB *bun.DB
}

func NewRepo added in v0.10.0

func NewRepo(db *bun.DB) (*Repo, error)

func (*Repo) GetGroupByID added in v0.10.0

func (r *Repo) GetGroupByID(ctx context.Context, id string) (*groupModel, error)

func (*Repo) GetGroups added in v0.10.0

func (r *Repo) GetGroups(ctx context.Context) ([]groupModel, error)

func (*Repo) GetStories added in v0.10.0

func (r *Repo) GetStories(ctx context.Context) ([]storyModel, error)

func (*Repo) GetStoryByID added in v0.10.0

func (r *Repo) GetStoryByID(ctx context.Context, id string) (*storyModel, error)

func (*Repo) GetVersion added in v0.10.0

func (r *Repo) GetVersion(ctx context.Context) (string, error)

func (*Repo) InsertGroups added in v0.10.0

func (r *Repo) InsertGroups(ctx context.Context, groups []groupModel) error

func (*Repo) InsertStories added in v0.10.0

func (r *Repo) InsertStories(ctx context.Context, stories []storyModel) error

func (*Repo) TruncateGroups added in v0.10.0

func (r *Repo) TruncateGroups(ctx context.Context) error

func (*Repo) TruncateStories added in v0.10.0

func (r *Repo) TruncateStories(ctx context.Context) (err error)

func (Repo) UpdateAvg added in v0.10.0

func (r Repo) UpdateAvg(ctx context.Context, version string, gms []groupModel, sms []storyModel) error

func (*Repo) UpsertVersion added in v0.10.0

func (r *Repo) UpsertVersion(ctx context.Context, resVersion string) error

type Service

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

func NewService

func NewService(r *Repo) *Service

func (*Service) GetGroupByID

func (s *Service) GetGroupByID(ctx context.Context, id string) (*Group, error)

func (*Service) GetGroups

func (s *Service) GetGroups(ctx context.Context) ([]Group, error)

func (*Service) GetStories

func (s *Service) GetStories(ctx context.Context) ([]Story, error)

func (*Service) GetStoryByID

func (s *Service) GetStoryByID(ctx context.Context, id string) (*Story, error)

func (*Service) GetVersion

func (s *Service) GetVersion(ctx context.Context) (string, error)

func (*Service) Reset added in v0.7.0

func (s *Service) Reset(ctx context.Context) error

func (*Service) UpdateAvg added in v0.10.0

func (s *Service) UpdateAvg(ctx context.Context, version string, avg Avg) (err error)

type Story

type Story struct {
	ID      string  `json:"id"`
	Code    string  `json:"code"`
	Name    string  `json:"name"`
	Tag     string  `json:"tag"`
	GroupID string  `json:"groupID"`
	Assets  []Asset `json:"assets"`
}

Jump to

Keyboard shortcuts

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