newsroom

package
v0.0.0-...-8d1786a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Charter

type Charter struct {
	Name        string                          `json:"name,omitempty"`
	LogoURL     string                          `json:"logoUrl,omitempty"`
	NewsroomURL string                          `json:"newsroomUrl,omitempty"`
	Tagline     string                          `json:"tagline,omitempty"`
	Roster      []*CharterRosterMember          `json:"roster,omitempty"`
	Signatures  []*CharterConstitutionSignature `json:"signatures,omitempty"`
	Mission     *CharterMission                 `json:"mission,omitempty"`
	SocialURLs  *CharterSocialURLs              `json:"socialUrls,omitempty"`
}

Charter represents charter data for a newsroom, mirrors structure from the FE client store as defined here https://github.com/joincivil/Civil/blob/master/packages/core/src/types.ts#L73-L87

type CharterConstitutionSignature

type CharterConstitutionSignature struct {
	Signer    string `json:"signer,omitempty"`
	Signature string `json:"signature,omitempty"`
	Message   string `json:"message,omitempty"`
}

CharterConstitutionSignature represents the signing of the constitution for a newsroom

func (*CharterConstitutionSignature) AsMap

func (c *CharterConstitutionSignature) AsMap() map[string]interface{}

AsMap converts the CharterConstitutionSignature to a map

type CharterMission

type CharterMission struct {
	Purpose       string `json:"purpose,omitempty"`
	Structure     string `json:"structure,omitempty"`
	Revenue       string `json:"revenue,omitempty"`
	Encumbrances  string `json:"encumbrances,omitempty"`
	Miscellaneous string `json:"miscellaneous,omitempty"`
}

CharterMission represents mission statements for a charter

func (*CharterMission) AsMap

func (c *CharterMission) AsMap() map[string]interface{}

AsMap converts the CharterMission to a map

type CharterRosterMember

type CharterRosterMember struct {
	Name       string             `json:"name,omitempty"`
	Role       string             `json:"role,omitempty"`
	Bio        string             `json:"bio,omitempty"`
	EthAddress string             `json:"ethAddress,omitempty"`
	SocialURLs *CharterSocialURLs `json:"socialUrls,omitempty"`
	AvatarURL  string             `json:"avatarUrl,omitempty"`
	Signature  string             `json:"signature,omitempty"`
}

CharterRosterMember represents a member of a newsroom roster

func (*CharterRosterMember) AsMap

func (c *CharterRosterMember) AsMap() map[string]interface{}

AsMap converts the CharterRosterMember to a map

type CharterSocialURLs

type CharterSocialURLs struct {
	Twitter   string `json:"twitter,omitempty"`
	Facebook  string `json:"facebook,omitempty"`
	Instagram string `json:"instagram,omitempty"`
	Linkedin  string `json:"linkedin,omitempty"`
	Youtube   string `json:"youtube,omitempty"`
	Email     string `json:"email,omitempty"`
}

CharterSocialURLs represents a social URL in the charter

func (*CharterSocialURLs) AsMap

func (c *CharterSocialURLs) AsMap() map[string]interface{}

AsMap converts the CharterSocialURL to a map

type IPFSHelper

type IPFSHelper interface {
	Cat(path string) (io.ReadCloser, error)
	Add(r io.Reader, options ...shell.AddOpts) (string, error)
}

IPFSHelper describes the methods needed to interact with IPFS sh := shell.NewShell("https://ipfs.infura.io:5001") satisfies this interface

type Newsroom

type Newsroom struct {
	NewsroomDeployTx string   `json:"deployTx,omitempty"`
	ContractAddress  string   `json:"contractAddress,omitempty"`
	MultisigAddress  string   `json:"multisigAddress,omitempty"`
	Name             string   `json:"name,omitempty"`
	Charter          *Charter `json:"charter,omitempty"`
}

Newsroom represents data about a newsroom, including the charter

type Service

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

Service provides methods to create and manage newsrooms

func NewService

func NewService(eth *eth.Helper, ipfs IPFSHelper, addresses eth.DeployerContractAddresses) (*Service, error)

NewService builds a new newsroom Service

func (*Service) AdminAddMultisigOwner

func (s *Service) AdminAddMultisigOwner(newsroomAddress common.Address, newOwner common.Address) (common.Hash, error)

AdminAddMultisigOwner adds an owner to the newsroom multisig

func (*Service) AdminApplyToTCR

func (s *Service) AdminApplyToTCR(newsroomAddress common.Address, tokens *big.Int) (common.Hash, error)

AdminApplyToTCR applies the newsroom to the TCR

func (*Service) AdminApproveTCRTokenTransfer

func (s *Service) AdminApproveTCRTokenTransfer(newsroomAddress common.Address, tokens *big.Int) (common.Hash, error)

AdminApproveTCRTokenTransfer approves the specified number of tokens to be transferred by the TCR contract this needs to be called before `AdminApplyToTCR` otherwise the tx will fail

func (*Service) AdminRemoveMultisigOwner

func (s *Service) AdminRemoveMultisigOwner(newsroomAddress common.Address, owner common.Address) (common.Hash, error)

AdminRemoveMultisigOwner removes the address from the multisig

func (*Service) CreateNewsroom

func (s *Service) CreateNewsroom(name string, charterHash string) (common.Hash, error)

CreateNewsroom creates a new newsroom smart contract

func (*Service) GetCharter

func (s *Service) GetCharter(newsroomAddress common.Address) (*Charter, error)

GetCharter retrieves the charter of the newsroom at the provided address

func (*Service) GetMultisigMembers

func (s *Service) GetMultisigMembers(newsroomAddress common.Address) ([]common.Address, error)

GetMultisigMembers returns the Addresses on the Multisig associated with the provided newsroom address

func (*Service) GetNewsroomAddressFromTransaction

func (s *Service) GetNewsroomAddressFromTransaction(tx common.Hash) (common.Address, error)

GetNewsroomAddressFromTransaction retrieves the deployed Newsroom address from tx receipt logs

func (*Service) GetNewsroomName

func (s *Service) GetNewsroomName(newsroomAddress common.Address) (string, error)

GetNewsroomName retrieves the name of the newsroom at the provided address

func (*Service) GetOwner

func (s *Service) GetOwner(newsroomAddress common.Address) (common.Address, error)

GetOwner retrieves the address of the owner of the Newsroom

func (*Service) PublishCharter

func (s *Service) PublishCharter(charter Charter, pin bool) (string, error)

PublishCharter takes a charter and publishes to IPFS

func (*Service) RenameNewsroom

func (s *Service) RenameNewsroom(newsroomAddress common.Address, newName string) (common.Hash, error)

RenameNewsroom sets a new name for the Newsroom

Jump to

Keyboard shortcuts

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