Documentation
¶
Index ¶
- type Action
- type ActionProvider
- type ActionService
- type Actions
- type BaseQuorum
- type Bylaw
- type BylawRecord
- type Charter
- type CharterRecord
- type CharterService
- type GrantLocalMembershipParams
- type Local
- type LocalRecord
- type MemberService
- type Membership
- type MembershipRecord
- type PercentQuorum
- type Proposal
- type ProposalRecord
- type ProposalService
- type Quorum
- type QuorumKind
- type Repository
- func (repo *Repository) CreateLocal(tx *sql.Tx) (*LocalRecord, error)
- func (repo *Repository) CreateLocalCharter(tx *sql.Tx, request *CharterRecord) (*CharterRecord, error)
- func (repo *Repository) CreateLocalCharterBylaw(tx *sql.Tx, request *BylawRecord) (*BylawRecord, error)
- func (repo *Repository) CreateLocalMembership(tx *sql.Tx, local string, identity string) (*MembershipRecord, error)
- func (repo *Repository) CreateLocalProposal(tx *sql.Tx, bylawId string, params string) (*ProposalRecord, error)
- func (repo *Repository) FindBylawById(tx *sql.Tx, bylawId string) (*BylawRecord, error)
- func (repo *Repository) FindBylawsByCharter(tx *sql.Tx, charterId string) ([]*BylawRecord, error)
- func (repo *Repository) FindCharterById(tx *sql.Tx, charterId string) (*CharterRecord, error)
- func (repo *Repository) FindCharterByLocal(tx *sql.Tx, local string) (*CharterRecord, error)
- func (repo *Repository) FindMembershipsByIdentity(tx *sql.Tx, identity string) ([]*MembershipRecord, error)
- func (repo *Repository) FindMembershipsByLocal(tx *sql.Tx, local string) ([]*MembershipRecord, error)
- type Result
- type ThresholdQuorum
- type UnanimousQuorum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionProvider ¶
func GrantLocalMembership ¶
func GrantLocalMembership( identityService identities.IdentityService, localsRepo *Repository, ) ActionProvider
func UpdateCharter ¶
func UpdateCharter() ActionProvider
type ActionService ¶
type ActionService interface {
Actions() []Action
LookupActionByName(name string) (Action, error)
ValidateParams(session session.Session, actionName string, params common.M) (serialized []byte, validated any, err error)
}
func NewActionService ¶
func NewActionService(actions Actions) ActionService
type BaseQuorum ¶
type BaseQuorum struct {
QuorumKind QuorumKind
QuorumDeliberation *time.Duration
}
func (*BaseQuorum) Deliberation ¶
func (basic *BaseQuorum) Deliberation() *time.Duration
func (*BaseQuorum) Kind ¶
func (basic *BaseQuorum) Kind() QuorumKind
type Bylaw ¶
func (*Bylaw) MarshalJSON ¶
type BylawRecord ¶
type CharterRecord ¶
type CharterService ¶
type CharterService interface {
CreateLocal(session session.Session, charter *Charter) (*common.Ulid, error)
LookupCharterForLocal(session session.Session, localId *common.Ulid) (*Charter, error)
LookupBylawById(session session.Session, bylawId *common.Ulid) (*Bylaw, error)
}
func NewCharterService ¶
func NewCharterService( actionService ActionService, repo *Repository, ) CharterService
type LocalRecord ¶
type LocalRecord struct {
Id string
}
type MemberService ¶
type MemberService interface {
FindMembershipsForIdentity(session session.Session, identity *common.Ulid) ([]*Membership, error)
FindMembershipsForLocal(session session.Session, localId *common.Ulid) ([]*Membership, error)
}
func NewMemberService ¶
func NewMemberService( repo *Repository, ) MemberService
type Membership ¶
type MembershipRecord ¶
type PercentQuorum ¶
type ProposalRecord ¶
type ProposalService ¶
type ProposalService interface {
CreateProposal(session session.Session, bylawId *common.Ulid, params common.M) (*Proposal, error)
}
func NewProposalService ¶
func NewProposalService( actionService ActionService, charterService CharterService, repo *Repository, ) ProposalService
type Quorum ¶
type Quorum interface {
Kind() QuorumKind
Deliberation() *time.Duration
}
type QuorumKind ¶
type QuorumKind string
const ( Threshold QuorumKind = "threshold" Percent QuorumKind = "percent" Unanimous QuorumKind = "unanimous" )
type Repository ¶
func NewRepo ¶
func NewRepo( union database.Database, ) *Repository
func (*Repository) CreateLocal ¶
func (repo *Repository) CreateLocal(tx *sql.Tx) (*LocalRecord, error)
func (*Repository) CreateLocalCharter ¶
func (repo *Repository) CreateLocalCharter(tx *sql.Tx, request *CharterRecord) (*CharterRecord, error)
func (*Repository) CreateLocalCharterBylaw ¶
func (repo *Repository) CreateLocalCharterBylaw(tx *sql.Tx, request *BylawRecord) (*BylawRecord, error)
func (*Repository) CreateLocalMembership ¶
func (repo *Repository) CreateLocalMembership(tx *sql.Tx, local string, identity string) (*MembershipRecord, error)
func (*Repository) CreateLocalProposal ¶
func (repo *Repository) CreateLocalProposal(tx *sql.Tx, bylawId string, params string) (*ProposalRecord, error)
func (*Repository) FindBylawById ¶
func (repo *Repository) FindBylawById(tx *sql.Tx, bylawId string) (*BylawRecord, error)
func (*Repository) FindBylawsByCharter ¶
func (repo *Repository) FindBylawsByCharter(tx *sql.Tx, charterId string) ([]*BylawRecord, error)
func (*Repository) FindCharterById ¶
func (repo *Repository) FindCharterById(tx *sql.Tx, charterId string) (*CharterRecord, error)
func (*Repository) FindCharterByLocal ¶
func (repo *Repository) FindCharterByLocal(tx *sql.Tx, local string) (*CharterRecord, error)
func (*Repository) FindMembershipsByIdentity ¶
func (repo *Repository) FindMembershipsByIdentity(tx *sql.Tx, identity string) ([]*MembershipRecord, error)
func (*Repository) FindMembershipsByLocal ¶
func (repo *Repository) FindMembershipsByLocal(tx *sql.Tx, local string) ([]*MembershipRecord, error)
type ThresholdQuorum ¶
type UnanimousQuorum ¶
type UnanimousQuorum struct {
Quorum
}
Click to show internal directories.
Click to hide internal directories.