Documentation
¶
Index ¶
- Variables
- func Base64(filename string) (b []byte, err error)
- func DownloadFromWebStore(extensionID string, filename string) error
- func ID(filename string) (id string, err error)
- func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func Pack(src string, dst string, pk *rsa.PrivateKey) (err error)
- func SavePrivateKey(filename string, key *rsa.PrivateKey) error
- func SetWebStoreURL(u string)
- func Unpack(filename string) error
- func Unzip(r io.ReaderAt, size int64, unpacked string) error
- func Zip(w io.Writer, unpacked string) error
- type Extension
- func (e Extension) Base64() ([]byte, error)
- func (e Extension) ID() (string, error)
- func (e Extension) IsCRX3() bool
- func (e Extension) IsDir() bool
- func (e Extension) IsZip() bool
- func (e Extension) Pack(pk *rsa.PrivateKey) error
- func (e Extension) PackTo(dst string, pk *rsa.PrivateKey) error
- func (e Extension) String() string
- func (e Extension) Unpack() error
- func (e Extension) Unzip() error
- func (e Extension) Zip() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownFileExtension = errors.New("crx3: unknown file extension") ErrUnsupportedFileFormat = errors.New("crx3: unsupported file format") ErrExtensionNotSpecified = errors.New("crx3: extension id not specified") ErrPathNotFound = errors.New("crx3: filepath not found") ErrPrivateKeyNotFound = errors.New("crx3: private key not found") )
Functions ¶
func Base64 ¶
Base64 encodes an extension file to a base64 string. It returns a bytes and an error encountered while encodes, if any.
func DownloadFromWebStore ¶
DownloadFromWebStore downloads a Chrome extension from the web store. ExtensionID can be an identifier or an url.
func LoadPrivateKey ¶
func LoadPrivateKey(filename string) (*rsa.PrivateKey, error)
LoadPrivateKey loads the private key from a file into memory.
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
NewPrivateKey returns a new private key.
func Pack ¶
func Pack(src string, dst string, pk *rsa.PrivateKey) (err error)
Pack packs a zip file or unzipped directory into a crx extension.
func SavePrivateKey ¶
func SavePrivateKey(filename string, key *rsa.PrivateKey) error
SavePrivateKey saves private key to file.
func SetWebStoreURL ¶
func SetWebStoreURL(u string)
SetWebStoreURL sets the web store url to download extensions.
Types ¶
type Extension ¶
type Extension string
func (Extension) Pack ¶
func (e Extension) Pack(pk *rsa.PrivateKey) error
Pack packs zip file or an unpacked directory into a CRX3 file.
func (Extension) PackTo ¶
func (e Extension) PackTo(dst string, pk *rsa.PrivateKey) error
PackTo packs zip file or an unpacked directory into a CRX3 file.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.