server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package server is a generated GoMock package.

Package server is a generated GoMock package.

Package server is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

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

func NewFeed

func NewFeed(feedRepo FeedRepo, itemRepo ItemInFeedRepo) *Feed

func (Feed) All

func (f Feed) All() (*RespFeedAll, error)

func (Feed) CheckValidity

func (f Feed) CheckValidity(req *ReqFeedCheckValidity) (*RespFeedCheckValidity, error)

func (Feed) Create

func (f Feed) Create(req *ReqFeedCreate) error

func (Feed) Delete

func (f Feed) Delete(req *ReqFeedDelete) error

func (Feed) Get

func (f Feed) Get(req *ReqFeedGet) (*RespFeedGet, error)

func (Feed) Refresh

func (f Feed) Refresh(req *ReqFeedRefresh) error

func (Feed) Update

func (f Feed) Update(req *ReqFeedUpdate) error

type FeedForm

type FeedForm struct {
	ID        uint      `json:"id"`
	Name      *string   `json:"name"`
	Link      *string   `json:"link"`
	Failure   *string   `json:"failure"`
	UpdatedAt time.Time `json:"updated_at"`
	Group     GroupForm `json:"group"`
}

type FeedRepo

type FeedRepo interface {
	All() ([]*model.Feed, error)
	Get(id uint) (*model.Feed, error)
	Create(feed []*model.Feed) error
	Update(id uint, feed *model.Feed) error
	Delete(id uint) error
}

type FeedinGroupRepo

type FeedinGroupRepo interface {
	UpdateGroupID(from uint, to uint) error
}

type Group

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

func NewGroup

func NewGroup(groupRepo GroupRepo, feedRepo FeedinGroupRepo) *Group

func (Group) All

func (g Group) All() (*RespGroupAll, error)

func (Group) Create

func (g Group) Create(req *ReqGroupCreate) error

func (Group) Delete

func (g Group) Delete(req *ReqGroupDelete) error

func (Group) Update

func (g Group) Update(req *ReqGroupUpdate) error

type GroupForm

type GroupForm struct {
	ID   uint    `json:"id"`
	Name *string `json:"name"`
}

type GroupRepo

type GroupRepo interface {
	All() ([]*model.Group, error)
	Create(group *model.Group) error
	Update(id uint, group *model.Group) error
	Delete(id uint) error
}

type Item

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

func NewItem

func NewItem(repo ItemRepo) *Item

func (Item) Delete

func (i Item) Delete(req *ReqItemDelete) error

func (Item) Get

func (i Item) Get(req *ReqItemGet) (*RespItemGet, error)

func (Item) List

func (i Item) List(req *ReqItemList) (*RespItemList, error)

func (Item) Update

func (i Item) Update(req *ReqItemUpdate) error

type ItemFeed

type ItemFeed struct {
	ID   uint    `json:"id"`
	Name *string `json:"name"`
}

type ItemForm

type ItemForm struct {
	ID      uint       `json:"id"`
	Title   *string    `json:"title"`
	Link    *string    `json:"link"`
	GUID    *string    `json:"guid"`
	Content *string    `json:"content"`
	PubDate *time.Time `json:"pub_date"`
	Unread  *bool      `json:"unread"`
	Feed    ItemFeed   `json:"feed"`
}

type ItemInFeedRepo

type ItemInFeedRepo interface {
	DeleteByFeed(id uint) error
}

type ItemRepo

type ItemRepo interface {
	List(filter repo.ItemFilter, offset, count *int) ([]*model.Item, int, error)
	Get(id uint) (*model.Item, error)
	Update(id uint, item *model.Item) error
	Delete(id uint) error
}

type MockFeedRepo

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

MockFeedRepo is a mock of FeedRepo interface.

func NewMockFeedRepo

func NewMockFeedRepo(ctrl *gomock.Controller) *MockFeedRepo

NewMockFeedRepo creates a new mock instance.

func (*MockFeedRepo) All

func (m *MockFeedRepo) All() ([]*model.Feed, error)

All mocks base method.

func (*MockFeedRepo) Create

func (m *MockFeedRepo) Create(feed []*model.Feed) error

Create mocks base method.

func (*MockFeedRepo) Delete

func (m *MockFeedRepo) Delete(id uint) error

Delete mocks base method.

func (*MockFeedRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFeedRepo) Get

func (m *MockFeedRepo) Get(id uint) (*model.Feed, error)

Get mocks base method.

func (*MockFeedRepo) Update

func (m *MockFeedRepo) Update(id uint, feed *model.Feed) error

Update mocks base method.

type MockFeedRepoMockRecorder

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

MockFeedRepoMockRecorder is the mock recorder for MockFeedRepo.

func (*MockFeedRepoMockRecorder) All

All indicates an expected call of All.

func (*MockFeedRepoMockRecorder) Create

func (mr *MockFeedRepoMockRecorder) Create(feed any) *gomock.Call

Create indicates an expected call of Create.

func (*MockFeedRepoMockRecorder) Delete

func (mr *MockFeedRepoMockRecorder) Delete(id any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockFeedRepoMockRecorder) Get

func (mr *MockFeedRepoMockRecorder) Get(id any) *gomock.Call

Get indicates an expected call of Get.

func (*MockFeedRepoMockRecorder) Update

func (mr *MockFeedRepoMockRecorder) Update(id, feed any) *gomock.Call

Update indicates an expected call of Update.

type MockFeedinGroupRepo

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

MockFeedinGroupRepo is a mock of FeedinGroupRepo interface.

func NewMockFeedinGroupRepo

func NewMockFeedinGroupRepo(ctrl *gomock.Controller) *MockFeedinGroupRepo

NewMockFeedinGroupRepo creates a new mock instance.

func (*MockFeedinGroupRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFeedinGroupRepo) UpdateGroupID

func (m *MockFeedinGroupRepo) UpdateGroupID(from, to uint) error

UpdateGroupID mocks base method.

type MockFeedinGroupRepoMockRecorder

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

MockFeedinGroupRepoMockRecorder is the mock recorder for MockFeedinGroupRepo.

func (*MockFeedinGroupRepoMockRecorder) UpdateGroupID

func (mr *MockFeedinGroupRepoMockRecorder) UpdateGroupID(from, to any) *gomock.Call

UpdateGroupID indicates an expected call of UpdateGroupID.

type MockGroupRepo

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

MockGroupRepo is a mock of GroupRepo interface.

func NewMockGroupRepo

func NewMockGroupRepo(ctrl *gomock.Controller) *MockGroupRepo

NewMockGroupRepo creates a new mock instance.

func (*MockGroupRepo) All

func (m *MockGroupRepo) All() ([]*model.Group, error)

All mocks base method.

func (*MockGroupRepo) Create

func (m *MockGroupRepo) Create(group *model.Group) error

Create mocks base method.

func (*MockGroupRepo) Delete

func (m *MockGroupRepo) Delete(id uint) error

Delete mocks base method.

func (*MockGroupRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGroupRepo) Update

func (m *MockGroupRepo) Update(id uint, group *model.Group) error

Update mocks base method.

type MockGroupRepoMockRecorder

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

MockGroupRepoMockRecorder is the mock recorder for MockGroupRepo.

func (*MockGroupRepoMockRecorder) All

All indicates an expected call of All.

func (*MockGroupRepoMockRecorder) Create

func (mr *MockGroupRepoMockRecorder) Create(group any) *gomock.Call

Create indicates an expected call of Create.

func (*MockGroupRepoMockRecorder) Delete

func (mr *MockGroupRepoMockRecorder) Delete(id any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockGroupRepoMockRecorder) Update

func (mr *MockGroupRepoMockRecorder) Update(id, group any) *gomock.Call

Update indicates an expected call of Update.

type MockItemInFeedRepo

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

MockItemInFeedRepo is a mock of ItemInFeedRepo interface.

func NewMockItemInFeedRepo

func NewMockItemInFeedRepo(ctrl *gomock.Controller) *MockItemInFeedRepo

NewMockItemInFeedRepo creates a new mock instance.

func (*MockItemInFeedRepo) DeleteByFeed

func (m *MockItemInFeedRepo) DeleteByFeed(id uint) error

DeleteByFeed mocks base method.

func (*MockItemInFeedRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockItemInFeedRepoMockRecorder

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

MockItemInFeedRepoMockRecorder is the mock recorder for MockItemInFeedRepo.

func (*MockItemInFeedRepoMockRecorder) DeleteByFeed

func (mr *MockItemInFeedRepoMockRecorder) DeleteByFeed(id any) *gomock.Call

DeleteByFeed indicates an expected call of DeleteByFeed.

type MockItemRepo

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

MockItemRepo is a mock of ItemRepo interface.

func NewMockItemRepo

func NewMockItemRepo(ctrl *gomock.Controller) *MockItemRepo

NewMockItemRepo creates a new mock instance.

func (*MockItemRepo) Delete

func (m *MockItemRepo) Delete(id uint) error

Delete mocks base method.

func (*MockItemRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockItemRepo) Get

func (m *MockItemRepo) Get(id uint) (*model.Item, error)

Get mocks base method.

func (*MockItemRepo) List

func (m *MockItemRepo) List(filter repo.ItemFilter, offset, count *int) ([]*model.Item, int, error)

List mocks base method.

func (*MockItemRepo) Update

func (m *MockItemRepo) Update(id uint, item *model.Item) error

Update mocks base method.

type MockItemRepoMockRecorder

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

MockItemRepoMockRecorder is the mock recorder for MockItemRepo.

func (*MockItemRepoMockRecorder) Delete

func (mr *MockItemRepoMockRecorder) Delete(id any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockItemRepoMockRecorder) Get

func (mr *MockItemRepoMockRecorder) Get(id any) *gomock.Call

Get indicates an expected call of Get.

func (*MockItemRepoMockRecorder) List

func (mr *MockItemRepoMockRecorder) List(filter, offset, count any) *gomock.Call

List indicates an expected call of List.

func (*MockItemRepoMockRecorder) Update

func (mr *MockItemRepoMockRecorder) Update(id, item any) *gomock.Call

Update indicates an expected call of Update.

type Paginate

type Paginate struct {
	Count  *int `query:"count" validate:"omitnil,min=0"`
	Offset *int `query:"offset" validate:"omitnil,min=0"`
}

type ReqFeedCheckValidity

type ReqFeedCheckValidity struct {
	Link string `json:"link" validate:"required"`
}

type ReqFeedCreate

type ReqFeedCreate struct {
	Feeds []struct {
		Name *string `json:"name" validate:"required"`
		Link *string `json:"link" validate:"required"`
	} `json:"feeds" validate:"required"`
	GroupID uint `json:"group_id" validate:"required"`
}

type ReqFeedDelete

type ReqFeedDelete struct {
	ID uint `param:"id" validate:"required"`
}

type ReqFeedGet

type ReqFeedGet struct {
	ID uint `param:"id" validate:"required"`
}

type ReqFeedRefresh

type ReqFeedRefresh struct {
	ID  *uint `json:"id"`
	All *bool `json:"all"`
}

type ReqFeedUpdate

type ReqFeedUpdate struct {
	ID      uint    `param:"id" validate:"required"`
	Name    *string `json:"name"`
	Link    *string `json:"link"`
	GroupID *uint   `json:"group_id"`
}

type ReqGroupCreate

type ReqGroupCreate struct {
	Name *string `json:"name" validate:"required"`
}

type ReqGroupDelete

type ReqGroupDelete struct {
	ID uint `param:"id" validate:"required"`
}

type ReqGroupUpdate

type ReqGroupUpdate struct {
	ID   uint    `param:"id" validate:"required"`
	Name *string `json:"name" validate:"required"`
}

type ReqItemDelete

type ReqItemDelete struct {
	ID uint `param:"id" validate:"required"`
}

type ReqItemGet

type ReqItemGet struct {
	ID uint `param:"id" validate:"required"`
}

type ReqItemList

type ReqItemList struct {
	Paginate
	Keyword *string `query:"keyword"`
	FeedID  *uint   `query:"feed_id"`
	Unread  *bool   `query:"unread"`
}

type ReqItemUpdate

type ReqItemUpdate struct {
	ID     uint  `param:"id" validate:"required"`
	Unread *bool `json:"unread"`
}

type RespFeedAll

type RespFeedAll struct {
	Feeds []*FeedForm `json:"feeds"`
}

type RespFeedCheckValidity

type RespFeedCheckValidity struct {
	FeedLinks []ValidityItem `json:"feed_links"`
}

type RespFeedGet

type RespFeedGet FeedForm

type RespGroupAll

type RespGroupAll struct {
	Groups []*GroupForm `json:"groups"`
}

type RespItemGet

type RespItemGet ItemForm

type RespItemList

type RespItemList struct {
	Total *int        `json:"total"`
	Items []*ItemForm `json:"items"`
}

type ValidityItem

type ValidityItem struct {
	Title *string `json:"title"`
	Link  *string `json:"link"`
}

Jump to

Keyboard shortcuts

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