v.vmod #

fn decode #

fn decode(contents string) ?Manifest

fn from_file #

fn from_file(vmod_path string) ?Manifest

fn get_cache #

fn get_cache() &ModFileCacher

fn new_mod_file_cacher #

fn new_mod_file_cacher() &ModFileCacher

struct Manifest #

struct Manifest {
pub mut:
	name         string
	version      string
	description  string
	dependencies []string
	license      string
	repo_url     string
	author       string
	unknown      map[string][]string
}

struct ModFileAndFolder #

struct ModFileAndFolder {
pub:
	vmod_file string

	vmod_folder string
}

This file provides a caching mechanism for seeking quickly whether a given folder has a v.mod file in it or in any of its parent folders. ModFileCacher.get(folder) works in such a way, that given this tree: examples/hanoi.v vlib/v.mod vlib/v/tests/project_with_c_code/mod1/v.mod vlib/v/tests/project_with_c_code/mod1/wrapper.v ----------------- ModFileCacher.get('examples') => ModFileAndFolder{'', 'examples'} ModFileCacher.get('vlib/v/tests') => ModFileAndFolder{'vlib/v.mod', 'vlib'} ModFileCacher.get('vlib/v') => ModFileAndFolder{'vlib/v.mod', 'vlib'} ModFileCacher.get('vlib/v/test/project_with_c_code/mod1') => ModFileAndFolder{'vlib/v/test/project_with_c_code/mod1/v.mod', 'vlib/v/test/project_with_c_code/mod1'}

struct ModFileCacher #

struct ModFileCacher {
mut:
	cache map[string]ModFileAndFolder

	folder_files map[string][]string
}

fn (ModFileCacher) debug #

fn (mcache &ModFileCacher) debug()

fn (ModFileCacher) get_by_file #

fn (mut mcache ModFileCacher) get_by_file(vfile string) ModFileAndFolder

fn (ModFileCacher) get_by_folder #

fn (mut mcache ModFileCacher) get_by_folder(vfolder string) ModFileAndFolder