Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

1.2 KB
Raw Blame
package organization

import (
	"context"
	"net/http"

	"github.com/SigNoz/signoz/pkg/types"
	"github.com/SigNoz/signoz/pkg/valuer"
)

type Getter interface {
	// Get gets the organization based on the given id
	Get(context.Context, valuer.UUID) (*types.Organization, error)

	// GetByIDOrName gets the organization by id, falling back to name on not found.
	// The boolean is true when the name fallback path was used.
	GetByIDOrName(context.Context, valuer.UUID, string) (*types.Organization, bool, error)

	// ListByOwnedKeyRange gets all the organizations owned by the instance
	ListByOwnedKeyRange(context.Context) ([]*types.Organization, error)

	// Gets the organization by name
	GetByName(context.Context, string) (*types.Organization, error)
}

type Setter interface {
	// Create creates the given organization
	Create(context.Context, *types.Organization, func(context.Context, valuer.UUID) error) error

	// Update updates the given organization
	Update(context.Context, *types.Organization) error
}

type Handler interface {
	// Get gets the organization based on the id in claims
	Get(http.ResponseWriter, *http.Request)

	// Update updates the organization based on the id in claims
	Update(http.ResponseWriter, *http.Request)
}