firasdarwish/ore

View on GitHub
internal/models/simple_counter.go

Summary

Maintainability
A
1 hr
Test Coverage
package models

import (
    "context"
    "github.com/firasdarwish/ore/internal/interfaces"
)

type SimpleCounter struct {
    Counter int
}

func (c *SimpleCounter) AddOne() {
    c.Counter++
}

func (c *SimpleCounter) GetCount() int {
    return c.Counter
}

func (c *SimpleCounter) New(ctx context.Context) (interfaces.SomeCounter, context.Context) {
    return &SimpleCounter{}, ctx
}