services

package
v0.0.0-...-d33a02e Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNamespaceAlreadyExists = errors.New("namespace with name already exists in organization")
	ErrNamespaceNotFound      = errors.New("namespace not found")
	ErrSchemaNotFound         = errors.New("schema not found")
)

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	Id             string            `json:"id"`
	OrganizationId string            `json:"organization_id"`
	Name           string            `json:"name"`
	Key            string            `json:"key"`
	Expires        time.Time         `json:"expires"`
	Scope          map[string]string `json:"scope"`
}

type ApiKeyProvider

type ApiKeyProvider interface {
	GenerateNewApiKey(orgId string) (*ApiKey, error)
	ListKeys(orgId string) ([]*ApiKey, error)
	GetKey(key string) *ApiKey
	DeleteKey(apiId string) error
}

type Namespace

type Namespace struct {
	Id             string
	Name           string
	OrganizationId string
	SchemaId       string
	SchemaVersion  string
}

type NamespaceServiceProvider

type NamespaceServiceProvider interface {
	CreateNamespace(orgId string, name string, schemaId string, schemaVersion string, vars map[string]string) (*Namespace, error)
	GetNamespaceById(orgId string, nsId string) (*Namespace, error)
	ListNamespaces(orgId string) ([]*Namespace, error)
	ExistsByName(orgId, nsName string) bool
	UpdateNamespace(orgId string, nsId string, nsName string, schemaVersion string) error
	DeleteNamespace(orgId string, nsId string) error
	ListNamespaceVars(orgId string, nsId string) ([]*NamespaceVar, error)
	GetNamespaceVariable(orgId string, nsId string, varId string) (*NamespaceVar, error)
	CreateNamespaceVariable(orgId string, nsId string, varId string, value string) (*NamespaceVar, error)
	UpdateNamespaceVariable(orgId string, nsId string, varId string, value string) (*NamespaceVar, error)
	DeleteNamespaceVariable(orgId string, nsId string, varId string) error
	GetVariablesAsMap(orgId string, nsId string) (map[string]string, error)
	NamespaceVariableExists(orgId string, nsId string, varId string) bool
}

type NamespaceVar

type NamespaceVar struct {
	Key         string
	Value       string
	OrgId       string
	NamespaceId string
}

type Organization

type Organization struct {
	Id      string            `json:"id"`
	Name    string            `json:"name"`
	OrgVars map[string]string `json:"vars"`
}

type OrganizationServiceProvider

type OrganizationServiceProvider interface {
	NewOrganization(organizationName string) (*Organization, error)
	GetOrganizationById(orgId string) (*Organization, error)
	ExistsById(orgId string) bool
	ExistsByName(orgName string) bool
	UpdateOrganization(orgId string, orgName string, orgVars map[string]string) (*Organization, error)
	DeleteOrganization(organizationId string) error
}

type OrganizationVar

type OrganizationVar struct {
	Id    string `json:"id"`
	OrgId string `json:"orgid"`
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Schema

type Schema struct {
	Id             string
	OrganizationId string
	Name           string
}

type SchemaServiceProvider

type SchemaServiceProvider interface {
	CreateSchema(orgId string, name string) (*Schema, error)
	ListSchemaInOrganization(orgId string) ([]*Schema, error)
	GetSchemaById(orgId string, schemaId string) (*Schema, error)
	UpdateSchema(schema Schema) error
	DeleteSchema(orgId string, schemaId string) error
	ListSchemaVersions(orgId string, schemaId string) ([]*SchemaVersion, error)
	CreateSchemaVersion(orgId string, schemaId string, resources map[string]string, published bool) (*SchemaVersion, error)
	GetSchemaVersion(orgId string, schemaId string, schemaVersionId string) (*SchemaVersion, error)
	UpdateSchemaVersion(orgId string, schemaId string, schemaVersionId string, resources map[string]string, published bool) (*SchemaVersion, error)
}

type SchemaVersion

type SchemaVersion struct {
	Id        int               `json:"id"`
	Published bool              `json:"published"`
	SchemaId  string            `json:"schema_id"`
	Resources map[string]string `json:"resources"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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