Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ServeCommand cli.Command = cli.Command{ Name: "serve", Aliases: []string{"s"}, Usage: "serve a static blog feed from markdown posts", Action: func(ctx context.Context, c *cli.Command) error { fmt.Println("serve") return nil }, }
ServeCommand is the main entry point for the GoBlog serve CLI tool. This command is used to set up all the flags, usage info and the action to for serve.
Functions ¶
This section is empty.
Types ¶
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
InMemoryCache is an in-memory implementation of the Cache interface. It stores a single GeneratedBlog instance in memory using a mutex for concurrent access protection.
All methods are safe for concurrent use by multiple goroutines. The cache has no expiration or size limits - content remains cached until explicitly cleared or replaced.
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
NewInMemoryCache creates a new InMemoryCache instance. The cache is initially empty.
func (*InMemoryCache) Clear ¶
func (m *InMemoryCache) Clear(ctx context.Context) error
Clear removes all cached content. After calling Clear, Get will return nil until Set is called again. Clear is safe for concurrent use and uses a write lock to ensure exclusive access during the operation.
func (*InMemoryCache) Get ¶
func (m *InMemoryCache) Get(ctx context.Context) (*generator.GeneratedBlog, error)
Get retrieves the cached blog content. It returns nil if no content is currently cached. Get is safe for concurrent use and uses a read lock to allow multiple concurrent reads.
func (*InMemoryCache) Set ¶
func (m *InMemoryCache) Set(ctx context.Context, blog *generator.GeneratedBlog) error
Set stores the provided blog content in the cache. Any previously cached content is replaced. Set is safe for concurrent use and uses a write lock to ensure exclusive access during updates.