feed

package
v0.0.0-...-4bd84e9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(s IService, store *session.Store) *Controller

func (*Controller) AddPost

func (uc *Controller) AddPost(c *fiber.Ctx) error

func (*Controller) GetAll

func (uc *Controller) GetAll() []Post

type IRepository

type IRepository interface {
	GetAllPosts() []Post
	Upsert(post *Post) error
}

type IService

type IService interface {
	GetAllPosts() []Post
	AddPost(post *Post) error
}

type Post

type Post struct {
	Username string `json:"username" bson:"username"`
	Image    string `json:"image" bson:"image"`
	Context  string `json:"context" bson:"context"`
}

type Repository

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

func NewRepository

func NewRepository(ctx context.Context, client *mongo.Client) *Repository

func (*Repository) GetAllPosts

func (r *Repository) GetAllPosts() []Post

func (*Repository) Upsert

func (r *Repository) Upsert(post *Post) error

type Service

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

func NewService

func NewService(r IRepository) *Service

func (*Service) AddPost

func (s *Service) AddPost(post *Post) error

func (*Service) GetAllPosts

func (s *Service) GetAllPosts() []Post

Jump to

Keyboard shortcuts

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