app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 5 Imported by: 1 module, 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

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