integrationkey

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(ctx context.Context, db *sql.DB) (*DB, error)

func (*DB) Authorize

func (db *DB) Authorize(ctx context.Context, id string, t Type) (context.Context, error)

func (*DB) Create

func (db *DB) Create(ctx context.Context, i *IntegrationKey) (*IntegrationKey, error)

func (*DB) CreateKeyTx

func (db *DB) CreateKeyTx(ctx context.Context, tx *sql.Tx, i *IntegrationKey) (*IntegrationKey, error)

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, id string) error

func (*DB) DeleteManyTx

func (db *DB) DeleteManyTx(ctx context.Context, tx *sql.Tx, ids []string) error

func (*DB) DeleteTx

func (db *DB) DeleteTx(ctx context.Context, tx *sql.Tx, id string) error

func (*DB) FindAllByService

func (db *DB) FindAllByService(ctx context.Context, serviceID string) ([]IntegrationKey, error)

func (*DB) FindOne

func (db *DB) FindOne(ctx context.Context, id string) (*IntegrationKey, error)

func (*DB) GetServiceID

func (db *DB) GetServiceID(ctx context.Context, id string, t Type) (string, error)

type IntegrationKey

type IntegrationKey struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Type      Type   `json:"type"`
	ServiceID string `json:"service_id"`
}

func (IntegrationKey) Normalize

func (i IntegrationKey) Normalize() (*IntegrationKey, error)

type Store

type Store interface {
	Authorize(ctx context.Context, id string, integrationType Type) (context.Context, error)
	GetServiceID(ctx context.Context, id string, integrationType Type) (string, error)
	Create(ctx context.Context, i *IntegrationKey) (*IntegrationKey, error)
	CreateKeyTx(context.Context, *sql.Tx, *IntegrationKey) (*IntegrationKey, error)
	FindOne(ctx context.Context, id string) (*IntegrationKey, error)
	FindAllByService(ctx context.Context, id string) ([]IntegrationKey, error)
	Delete(ctx context.Context, id string) error
	DeleteTx(ctx context.Context, tx *sql.Tx, id string) error
	DeleteManyTx(ctx context.Context, tx *sql.Tx, ids []string) error
}

type Type

type Type string

Type is the entity that needs an integration.

const (
	TypeGrafana Type = "grafana"
	TypeGeneric Type = "generic"
	TypeEmail   Type = "email"
)

Types

func (*Type) Scan

func (s *Type) Scan(value interface{}) error

func (Type) Value

func (s Type) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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