trident

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CRLF = pf.CRLF

Variables

View Source
var AppName = "Trident"
View Source
var AppSchemaVersion = 0

The version of the Database

View Source
var AppSetupVersion = 0

Version of AppSetup

View Source
var Copyright = "(C) 2015-2016 The Trident Project"
View Source
var Website = "https:///tridentli"

Functions

func Mail_PassResetNominator

func Mail_PassResetNominator(ctx pf.PfCtx, email pf.PfUserEmail, is_reset bool, user_email pf.PfUserEmail, nom_portion string) (err error)

func Mail_PassResetUser

func Mail_PassResetUser(ctx pf.PfCtx, email pf.PfUserEmail, is_reset bool, nom_email pf.PfUserEmail, user_portion string) (err error)

func NewTriCtx

func NewTriCtx() pf.PfCtx

func NewTriGroup

func NewTriGroup() pf.PfGroup

Don't call directly, use ctx.NewGroup()

func NewTriUser

func NewTriUser() pf.PfUser

func TriMenuOverride

func TriMenuOverride(ctx pf.PfCtx, menu *pf.PfMenu)

Types

type TriCtx

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

func TriGetCtx

func TriGetCtx(ctx pf.PfCtx) (tctx *TriCtx)

func (*TriCtx) HasSelectedVouchee

func (tctx *TriCtx) HasSelectedVouchee() bool

func (*TriCtx) SelectVouchee

func (tctx *TriCtx) SelectVouchee(username string, perms pf.Perm) (err error)

func (*TriCtx) SelectedVouchee

func (tctx *TriCtx) SelectedVouchee() (user TriUser)

func (*TriCtx) TriSelectedGroup

func (tctx *TriCtx) TriSelectedGroup() (grp TriGroup)

func (*TriCtx) TriSelectedUser

func (tctx *TriCtx) TriSelectedUser() (user TriUser)

func (*TriCtx) TriTheUser

func (tctx *TriCtx) TriTheUser() (user TriUser)

type TriGroup

type TriGroup interface {
	pf.PfGroup
	Add_default_attestations(ctx pf.PfCtx) (err error)
	GetVouch_adminonly() bool
	GetAttestations() (output []TriGroupAttestation, err error)
	GetAttestationsKVS() (kvs keyval.KeyVals, err error)
}

type TriGroupAttestation

type TriGroupAttestation struct {
	Ident      string
	Descr      string
	TrustGroup string
}

type TriGroupMember

type TriGroupMember interface {
	pf.PfGroupMember
	GetVouchesFor() int
	GetVouchesBy() int
	GetVouchesForMe() int
	GetVouchesByMe() int
}

func NewTriGroupMember

func NewTriGroupMember() TriGroupMember

type TriGroupMemberS

type TriGroupMemberS struct {
	pf.PfGroupMember
	VouchesFor   int
	VouchesBy    int
	VouchesForMe int
	VouchesByMe  int
}

func (*TriGroupMemberS) GetVouchesBy

func (o *TriGroupMemberS) GetVouchesBy() int

func (*TriGroupMemberS) GetVouchesByMe

func (o *TriGroupMemberS) GetVouchesByMe() int

func (*TriGroupMemberS) GetVouchesFor

func (o *TriGroupMemberS) GetVouchesFor() int

func (*TriGroupMemberS) GetVouchesForMe

func (o *TriGroupMemberS) GetVouchesForMe() int

type TriGroupS

type TriGroupS struct {
	pf.PfGroup
	Please_vouch    bool   `label:"Please Vouch" pfset:"group_admin" hint:"Members must vouch before becoming active"`
	Vouch_adminonly bool   `label:"Vouch group admins only" pfset:"group_admin" hint:"Only adminstators may Vouvh"`
	Min_invouch     int    `label:"Minimum Inbound Vouches" pfset:"group_admin" hint:"Number of incoming vouches required to vett."`
	Min_outvouch    int    `label:"Minimum Outbound Vouches" pfset:"group_admin" hint:"Number of outgoing vouches required"`
	Target_invouch  int    `label:"Target Invouches" pfset:"group_admin"`
	Max_inactivity  string `label:"Maximum Inactivity" pfset:"group_admin" coalesce:"30 days"`
	Can_time_out    bool   `label:"Can Time Out" pfset:"group_admin"`
	Max_vouchdays   int    `label:"Maximum Vouch Days" pfset:"group_admin"`
	Idle_guard      string `label:"Idle Guard" pfset:"group_admin" coalesce:"30 days"`
	Nom_enabled     bool   `label:"Nominations Enabled" pfset:"group_admin"`
}

func (*TriGroupS) Add_default_attestations

func (grp *TriGroupS) Add_default_attestations(ctx pf.PfCtx) (err error)

func (*TriGroupS) Add_default_mailinglists

func (grp *TriGroupS) Add_default_mailinglists(ctx pf.PfCtx) (err error)

func (*TriGroupS) Exists

func (grp *TriGroupS) Exists(group_name string) (exists bool)

func (*TriGroupS) GetAttestations

func (grp *TriGroupS) GetAttestations() (output []TriGroupAttestation, err error)

func (*TriGroupS) GetAttestationsKVS

func (grp *TriGroupS) GetAttestationsKVS() (kvs keyval.KeyVals, err error)

func (*TriGroupS) GetVouch_adminonly

func (grp *TriGroupS) GetVouch_adminonly() bool

func (*TriGroupS) ListGroupMembers

func (grp *TriGroupS) ListGroupMembers(search string, username string, offset int, max int, nominated bool, inclhidden bool, exact bool) (members []pf.PfGroupMember, err error)

func (*TriGroupS) Refresh

func (grp *TriGroupS) Refresh() (err error)

func (*TriGroupS) Select

func (grp *TriGroupS) Select(ctx pf.PfCtx, group_name string, perms pf.Perm) (err error)

type TriUser

type TriUser interface {
	pf.PfUser
	IsNominator(ctx pf.PfCtx, nom_name string) (ok bool)
	BestNominator(ctx pf.PfCtx) (nom_name string, err error)
}

type TriUserS

type TriUserS struct {
	pf.PfUser `pfset:"self" pfget:"self"`
}

func (*TriUserS) BestNominator

func (user *TriUserS) BestNominator(ctx pf.PfCtx) (nom_name string, err error)

func (*TriUserS) IsNominator

func (user *TriUserS) IsNominator(ctx pf.PfCtx, nom_name string) (ok bool)

type TriVouch

type TriVouch struct {
	Vouchor      string    `label:"Voucher" pfset:"self" pfcol:"voucher"`
	Vouchee      string    `label:"Vouchee" pfset:"self" pfcol:"vouchee"`
	GroupName    string    `label:"TrustGroup" pfset:"self" pfcol:"trustgroup"`
	Comment      string    `label:"Comment" pfset:"self" pfcol:"comment"`
	Entered      time.Time `label:"Entered" pfset:"nobody"`
	Positive     bool      `label:"Positive" pfset:"self" pfcol:"positive" hint:"Is the vouch of a positive nature"`
	State        string    `label:"Member state in trustgroup" pfset:"nobody"`
	Affiliation  string    `label:"Vouchee Afiliation" pfset:"nobody"`
	MyVouch      bool
	Attestations []TriGroupAttestation
}

func (*TriVouch) ListBy

func (vouch *TriVouch) ListBy(user TriUser, tg TriGroup, username string) (vouches []TriVouch, err error)

func (*TriVouch) ListFor

func (vouch *TriVouch) ListFor(user TriUser, tg TriGroup, username string) (vouches []TriVouch, err error)

func (*TriVouch) String

func (vouch *TriVouch) String() (out string)

type Vouch

type Vouch struct {
	Vouchor string
	Vouchee string
	Entered time.Time
}

func Vouches_Get

func Vouches_Get(ctx pf.PfCtx, group_name string) (v []Vouch, err error)

Jump to

Keyboard shortcuts

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