common

package module
v0.0.0-...-acd76c8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionResult

type ExecutionResult struct {
	Success  bool     `json:"success" cli:"success"`
	Error    string   `json:"error,omitempty" cli:"error,omitempty"`
	Warnings []string `json:"warnings,omitempty" cli:"warnings,omitempty"`
	Path     string   `json:"path,omitempty" cli:"path,omitempty"`
}

type FirebaseIDPRequest

type FirebaseIDPRequest struct {
	RequestURI          string `json:"requestUri,omitempty"`
	PostBody            string `json:"postBody,omitempty"`
	ReturnSecureToken   bool   `json:"returnSecureToken,omitempty"`
	ReturnIdpCredential bool   `json:"returnIdpCredential,omitempty"`
}

func NewFirebaseIDPRequest

func NewFirebaseIDPRequest(idToken, providerID, uri string, returnIdpCredential bool) FirebaseIDPRequest

type FirebaseIDPResponse

type FirebaseIDPResponse struct {
	FederatedId      string `json:"federatedId,omitempty"`
	ProviderId       string `json:"providerId,omitempty"`
	LocalId          string `json:"localId,omitempty"`
	EmailVerified    bool   `json:"emailVerified,omitempty"`
	Email            string `json:"email,omitempty"`
	OauthIdToken     string `json:"oauthIdToken,omitempty"`
	OauthAccessToken string `json:"oauthAccessToken,omitempty"`
	OauthTokenSecret string `json:"oauthTokenSecret,omitempty"`
	RawUserInfo      string `json:"rawUserInfo,omitempty"`
	FirstName        string `json:"firstName,omitempty"`
	LastName         string `json:"lastName,omitempty"`
	FullName         string `json:"fullName,omitempty"`
	DisplayName      string `json:"displayName,omitempty"`
	PhotoUrl         string `json:"photoUrl,omitempty"`
	IdToken          string `json:"idToken,omitempty"`
	RefreshToken     string `json:"refreshToken,omitempty"`
	ExpiresIn        string `json:"expiresIn,omitempty"`
	NeedConfirmation bool   `json:"needConfirmation,omitempty"`
}

func (FirebaseIDPResponse) Token

func (res FirebaseIDPResponse) Token() *oauth2.Token

type License

type License string

type LicenseResult

type LicenseResult struct {
	Name     string                 `json:"name,omitempty" cli:"name,omitempty"`
	Hash     string                 `json:"hash,omitempty" cli:"hash,omitempty"`
	Version  string                 `json:"version,omitempty" cli:"version,omitempty"`
	DateTime string                 `json:"datetime,omitempty" cli:"datetime,omitempty"`
	Meta     map[string]interface{} `json:"meta,omitempty" cli:"meta,omitempty"`
	Licenses []string               `json:"licenses,omitempty" cli:"licenses,omitempty"`
	Counts   map[string]int64       `json:"counts,omitempty" cli:"counts,omitempty"`
	Indeces  []string               `json:"indeces,omitempty" cli:"indeces,omitempty"`
}

type Module

type Module struct {
	Name       string                 `json:"name,omitempty"`
	NormalName string                 `json:"normalName,omitempty"`
	URL        string                 `json:"url,omitempty"`
	Hash       string                 `json:"hash,omitempty"`
	Version    string                 `json:"version,omitempty"`
	DateTime   string                 `json:"datetime,omitempty"`
	Meta       map[string]interface{} `json:"meta,omitempty"`
	Licenses   []License              `json:"licenses,omitempty"`
	NotFresh   bool                   `json:"-"`
	VCS        string                 `json:"vcs,omitempty"`
	Source     string                 `json:"source,omitempty"`
	// Dirty flags that the data from this module is untrusted and should be
	// stored in the cache
	Dirty bool `json:"dirty,omitempty"`

	Dependencies []Module         `json:"-"`
	Counts       map[string]int64 `json:"counts"`
	CountIsNull  bool             `json:"countIsNull"`
	Indeces      []string         `json:"indeces"`
	Rev          string           `json:"_rev,omitempty"`
}

func (*Module) Add

func (mod *Module) Add(key string, val interface{})

func (Module) DepIndeces

func (mod Module) DepIndeces() []string

func (Module) DepLicenseCounts

func (mod Module) DepLicenseCounts() (map[string]int64, []string)

func (Module) FlatDeps

func (mod Module) FlatDeps() []map[string]interface{}

func (Module) GetDBForm

func (mod Module) GetDBForm() (map[string]interface{}, error)

func (Module) GetName

func (mod Module) GetName() string

func (Module) GetSubIndex

func (mod Module) GetSubIndex() string

func (Module) GetTrunc

func (mod Module) GetTrunc() map[string]interface{}

func (Module) GetURL

func (mod Module) GetURL() string

func (Module) GetUniqueName

func (mod Module) GetUniqueName() string

func (Module) GetVCS

func (mod Module) GetVCS() string

func (Module) GetVersion

func (mod Module) GetVersion() Version

func (Module) Index

func (mod Module) Index() string

func (Module) IsFresh

func (mod Module) IsFresh() bool

func (Module) IsSame

func (mod Module) IsSame(name string) bool

func (Module) ToText

func (mod Module) ToText() string

func (*Module) UpdateVersion

func (mod *Module) UpdateVersion(vers Version)

type PRContext

type PRContext struct {
	Provider string //e.g. github
	Owner    string
	Repo     string
	Number   int
}

func (PRContext) Empty

func (prc PRContext) Empty() bool

type RawResult

type RawResult struct {
	Module Module
	Error  error
	UID    string
	ReqID  string
	PR     PRContext
}

type Request

type Request struct {
	ID         string                 `json:"id,omitempty" cli:"id,omitempty"`
	Timestamp  time.Time              `json:"timestamp,omitempty" cli:"timestamp,omitempty"`
	URL        string                 `json:"url,omitempty" cli:"url,omitempty"`
	Version    string                 `json:"version,omitempty" cli:"version,omitempty"`
	Hash       string                 `json:"hash,omitempty" cli:"hash,omitempty"`
	VCS        string                 `json:"vcs,omitempty" cli:"vcs,omitempty"`
	Source     string                 `json:"-" cli:"-"`
	Name       string                 `json:"name,omitempty" cli:"name,omitempty"`
	NormalName string                 `json:"-" cli:"-"`
	Meta       map[string]interface{} `json:"meta,omitempty" cli:"meta,omitempty"`
	UID        string                 `json:"uid,omitempty" cli:"user,omitempty"`
	PR         PRContext
	AckFn      func() `json:"-"`
}

func NewRequestFromModule

func NewRequestFromModule(mod Module) Request

func (Request) Ack

func (req Request) Ack()

func (Request) MarshalFirebase

func (req Request) MarshalFirebase() (map[string]interface{}, error)

func (Request) ToModuleShell

func (req Request) ToModuleShell() Module

type Result

type Result struct {
	ExecutionResult
	LicenseResult
}

type User

type User struct {
	ID             string         `db:"id"`
	GithubUsername sql.NullString `db:"github_username"`
	Plan           string         `db:"plan"`
}

type Version

type Version struct {
	Branch string
	Hash   string
}

func (Version) IsHashSet

func (vers Version) IsHashSet() bool

func (Version) String

func (vers Version) String() string

Jump to

Keyboard shortcuts

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