comments

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPermissionDenied = errors.New("permission denied")

Functions

func NewIDFilter

func NewIDFilter(userIDs []int64) models.Filter

Types

type CreateCmd

type CreateCmd struct {
	ObjectType string `json:"objectType"`
	ObjectID   string `json:"objectId"`
	Content    string `json:"content"`
}

type GetCmd

type GetCmd struct {
	ObjectType string `json:"objectType"`
	ObjectID   string `json:"objectId"`
	Limit      uint   `json:"limit"`
	BeforeId   int64  `json:"beforeId"`
}

type GetFilter

type GetFilter struct {
	Limit    uint
	BeforeID int64
}

type Service

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

func ProvideService

func ProvideService(cfg *setting.Cfg, store *sqlstore.SQLStore, live *live.GrafanaLive, features featuremgmt.FeatureToggles, accessControl accesscontrol.AccessControl) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, orgID int64, signedInUser *models.SignedInUser, cmd CreateCmd) (*commentmodel.CommentDto, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, orgID int64, signedInUser *models.SignedInUser, cmd GetCmd) ([]*commentmodel.CommentDto, error)

func (*Service) Run

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

Run Service.

type Storage

type Storage interface {
	Get(ctx context.Context, orgID int64, objectType string, objectID string, filter GetFilter) ([]*commentmodel.Comment, error)
	Create(ctx context.Context, orgID int64, objectType string, objectID string, userID int64, content string) (*commentmodel.Comment, error)
}

type UserIDFilter

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

func (*UserIDFilter) InCondition

func (a *UserIDFilter) InCondition() *models.InCondition

func (*UserIDFilter) JoinCondition

func (a *UserIDFilter) JoinCondition() *models.JoinCondition

func (*UserIDFilter) WhereCondition

func (a *UserIDFilter) WhereCondition() *models.WhereCondition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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