services

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package services provide types and interfaces that defines the various abstract services that different virtual module implementations depend upon. The reason its extracted out like this is to prevent a circular dependency from virtual modules to tables package and vice-versa.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context map[string]string

Context is a key-value store that holds general configuration parameters for the "environment" in which a module/function is executed in. For instance, it can be used to hold API tokens or configuration.

func (Context) GetBool

func (ctx Context) GetBool(key string) (bool, bool)

GetBool retrieves a key from the context and returns true if it matches the string "true" (case insensitive), otherwise it returns false if the key is unset or does not match "true". The second return indicates whether a value was set in the key at all.

func (Context) GetInt

func (ctx Context) GetInt(key string) (int, bool)

GetInt retrieves a key from the context and tries to parse it as an int. The second return val (bool) is false if the key could not be parsed or is unset

type RepoLocator

type RepoLocator interface {
	// Open opens the git repository specified by path.
	// The path need not be a file system path only and can also represent
	// a networked resource. The implementation should return a handle
	// to the initialized git repository instance, or throw an error.
	Open(ctx context.Context, path string) (*git.Repository, error)
}

RepoLocator is a service that the virtual modules rely upon to create or open an existing git repository.

Jump to

Keyboard shortcuts

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