content

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	ID   string                 `json:"id"`
	Data map[string]interface{} `json:"data"`
}

type Service

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

func NewContentService

func NewContentService(env *conf.Config, store *server.Store, statsd statsd.ClientInterface) *Service

func (*Service) AddContent

func (contentConfig *Service) AddContent(id string, payload *Content) error

AddContent adds or replaces a new content entity to the store

func (*Service) DeleteContent

func (contentConfig *Service) DeleteContent(id string) error

DeleteContent deletes a single content from the store

func (*Service) GetContentByID

func (contentConfig *Service) GetContentByID(id string) (*Content, error)

GetContentByID returns a single content by its id

func (*Service) ListContents

func (contentConfig *Service) ListContents() ([]*Content, error)

ListContents returns all content entities, in random order

func (*Service) UpdateContent

func (contentConfig *Service) UpdateContent(id string, payload *Content) error

UpdateContent updates an existing content (by calling AddContent) added the extra function for readability and future expansion

Jump to

Keyboard shortcuts

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