app

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMappingExists   = errors.New("app ID mapping already exists")
	ErrMappingNotFound = errors.New("app ID mapping not found")
)
View Source
var (
	ErrExists   = errors.New("app index already exists")
	ErrNotFound = errors.New("app not found")
)
View Source
var (
	ErrURLNotSet = errors.New("requested URL not set")
)

Functions

func IsValidAppID

func IsValidAppID(appID string) bool

IsValidAppID returns whether or not the provided string is a valid app ID.

Types

type Config

type Config struct {
	AppName            string
	SignTransactionURL *url.URL
	EventsURL          *url.URL
	WebhookSecret      string
}

type ConfigStore

type ConfigStore interface {
	// Add adds an app's config to the store.
	//
	// Returns ErrExists if the specified app index already exists in the store.
	Add(ctx context.Context, appIndex uint16, config *Config) error

	// Get gets an app's config by app index
	//
	// Returns ErrNotFound if it could not be found.
	Get(ctx context.Context, appIndex uint16) (*Config, error)
}

type Mapper

type Mapper interface {
	// Add adds a mapping between an app ID and an app index.
	//
	// Returns ErrMappingNotExists if a mapping with the specified app ID already exists in the store.
	Add(ctx context.Context, appID string, appIndex uint16) error

	// GetAppIndex gets the app index given an app ID.
	//
	// Returns ErrMappingNotFound if no mapping with the specified app ID was found.
	GetAppIndex(ctx context.Context, appID string) (appIndex uint16, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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