github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/tour/all.go (about)

     1  package tour
     2  
     3  import "sort"
     4  
     5  func init() {
     6  	for _, t := range allTopics {
     7  		Topics[t.ID] = t
     8  		IDs = append(IDs, t.ID)
     9  	}
    10  
    11  	sort.Sort(IDSlice(IDs))
    12  }
    13  
    14  // TODO move content into individual files if desired
    15  
    16  // TODO(brian): If sub-topics are needed, write recursively (as tree comprised
    17  // of Section nodes:
    18  //
    19  // type Section interface {
    20  // 	Sections() []Section
    21  // 	Topic() Topic
    22  // }
    23  
    24  var (
    25  	// TODO bootstrapping
    26  
    27  	// TODO pinning: ensuring a block is kept in local storage (i.e. not
    28  	// evicted from cache).
    29  
    30  	Introduction = Chapter(0)
    31  	FileBasics   = Chapter(1)
    32  	NodeBasics   = Chapter(2)
    33  	MerkleDag    = Chapter(3)
    34  	Network      = Chapter(4)
    35  	Daemon       = Chapter(5)
    36  	Routing      = Chapter(6)
    37  	Exchange     = Chapter(7)
    38  	Ipns         = Chapter(8)
    39  	Mounting     = Chapter(9)
    40  	Plumbing     = Chapter(10)
    41  	Formats      = Chapter(11)
    42  )
    43  
    44  // Topics contains a mapping of Tour Topic ID to Topic
    45  var allTopics = []Topic{
    46  	{ID: Introduction(0), Content: IntroHelloMars},
    47  	{ID: Introduction(1), Content: IntroTour},
    48  	{ID: Introduction(2), Content: IntroAboutIpfs},
    49  
    50  	{ID: FileBasics(1), Content: FileBasicsFilesystem},
    51  	{ID: FileBasics(2), Content: FileBasicsGetting},
    52  	{ID: FileBasics(3), Content: FileBasicsAdding},
    53  	{ID: FileBasics(4), Content: FileBasicsDirectories},
    54  	{ID: FileBasics(5), Content: FileBasicsDistributed},
    55  	{ID: FileBasics(6), Content: FileBasicsMounting},
    56  
    57  	{NodeBasics(0), NodeBasicsInit},
    58  	{NodeBasics(1), NodeBasicsHelp},
    59  	{NodeBasics(2), NodeBasicsUpdate},
    60  	{NodeBasics(3), NodeBasicsConfig},
    61  
    62  	{MerkleDag(0), MerkleDagIntro},
    63  	{MerkleDag(1), MerkleDagContentAddressing},
    64  	{MerkleDag(2), MerkleDagContentAddressingLinks},
    65  	{MerkleDag(3), MerkleDagRedux},
    66  	{MerkleDag(4), MerkleDagIpfsObjects},
    67  	{MerkleDag(5), MerkleDagIpfsPaths},
    68  	{MerkleDag(6), MerkleDagImmutability},
    69  	{MerkleDag(7), MerkleDagUseCaseUnixFS},
    70  	{MerkleDag(8), MerkleDagUseCaseGitObjects},
    71  	{MerkleDag(9), MerkleDagUseCaseOperationalTransforms},
    72  
    73  	{Network(0), Network_Intro},
    74  	{Network(1), Network_Ipfs_Peers},
    75  	{Network(2), Network_Daemon},
    76  	{Network(3), Network_Routing},
    77  	{Network(4), Network_Exchange},
    78  	{Network(5), Network_Intro},
    79  
    80  	// TODO daemon - {API, API Clients, Example} how old-school http + ftp
    81  	// clients show it
    82  	{Daemon(0), Daemon_Intro},
    83  	{Daemon(1), Daemon_Running_Commands},
    84  	{Daemon(2), Daemon_Web_UI},
    85  
    86  	{Routing(0), Routing_Intro},
    87  	{Routing(1), Rouing_Interface},
    88  	{Routing(2), Routing_Resolving},
    89  	{Routing(3), Routing_DHT},
    90  	{Routing(4), Routing_Other},
    91  
    92  	// TODO Exchange_Providing
    93  	// TODO Exchange_Providers
    94  	{Exchange(0), Exchange_Intro},
    95  	{Exchange(1), Exchange_Getting_Blocks},
    96  	{Exchange(2), Exchange_Strategies},
    97  	{Exchange(3), Exchange_Bitswap},
    98  
    99  	{Ipns(0), Ipns_Name_System},
   100  	{Ipns(1), Ipns_Mutability},
   101  	{Ipns(2), Ipns_PKI_Review},
   102  	{Ipns(3), Ipns_Publishing},
   103  	{Ipns(4), Ipns_Resolving},
   104  	{Ipns(5), Ipns_Consistency},
   105  	{Ipns(6), Ipns_Records_Etc},
   106  
   107  	{Mounting(0), Mounting_General},
   108  	{Mounting(1), Mounting_Ipfs},
   109  	{Mounting(2), Mounting_Ipns},
   110  
   111  	{Plumbing(0), Plumbing_Intro},
   112  	{Plumbing(1), Plumbing_Ipfs_Block},
   113  	{Plumbing(2), Plumbing_Ipfs_Object},
   114  	{Plumbing(3), Plumbing_Ipfs_Refs},
   115  	{Plumbing(4), Plumbing_Ipfs_Ping},
   116  	{Plumbing(5), Plumbing_Ipfs_Id},
   117  
   118  	{Formats(0), Formats_MerkleDag},
   119  	{Formats(1), Formats_Multihash},
   120  	{Formats(2), Formats_Multiaddr},
   121  	{Formats(3), Formats_Multicodec},
   122  	{Formats(4), Formats_Multicodec},
   123  	{Formats(5), Formats_Multikey},
   124  	{Formats(6), Formats_Protocol_Specific},
   125  }
   126  
   127  // Introduction
   128  
   129  var IntroHelloMars = Content{
   130  	Title: "Hello Mars",
   131  	Text: `
   132  	check things work
   133  	`,
   134  }
   135  var IntroTour = Content{
   136  	Title: "Hello Mars",
   137  	Text: `
   138  	how this works
   139  	`,
   140  }
   141  var IntroAboutIpfs = Content{
   142  	Title: "About IPFS",
   143  }
   144  
   145  // File Basics
   146  
   147  var FileBasicsFilesystem = Content{
   148  	Title: "Filesystem",
   149  	Text: `
   150  	`,
   151  }
   152  var FileBasicsGetting = Content{
   153  	Title: "Getting Files",
   154  	Text: `ipfs cat
   155  	`,
   156  }
   157  var FileBasicsAdding = Content{
   158  	Title: "Adding Files",
   159  	Text: `ipfs add
   160  	`,
   161  }
   162  var FileBasicsDirectories = Content{
   163  	Title: "Directories",
   164  	Text: `ipfs ls
   165  	`,
   166  }
   167  var FileBasicsDistributed = Content{
   168  	Title: "Distributed",
   169  	Text: `ipfs cat from mars
   170  	`,
   171  }
   172  var FileBasicsMounting = Content{
   173  	Title: "Getting Files",
   174  	Text: `ipfs mount (simple)
   175  	`,
   176  }
   177  
   178  // Node Basics
   179  
   180  var NodeBasicsInit = Content{
   181  	Title: "Basics - init",
   182  
   183  	// TODO touch on PKI
   184  	//
   185  	// This is somewhat relevant at ipfs init since the generated key pair is the
   186  	// basis for the node's identity in the network. A cursory nod may be
   187  	// sufficient at that stage, and goes a long way in explaining init's raison
   188  	// d'ĂȘtre.
   189  	// NB: user is introduced to ipfs init before ipfs add.
   190  	Text: `
   191  	`,
   192  }
   193  var NodeBasicsHelp = Content{
   194  	Title: "Basics - help",
   195  	Text: `
   196  	`,
   197  }
   198  var NodeBasicsUpdate = Content{
   199  	Title: "Basics - update",
   200  	Text: `
   201  	`,
   202  }
   203  var NodeBasicsConfig = Content{
   204  	Title: "Basics - config",
   205  	Text: `
   206  	`,
   207  }
   208  
   209  // Merkle DAG
   210  var MerkleDagIntro = Content{}
   211  var MerkleDagContentAddressing = Content{}
   212  var MerkleDagContentAddressingLinks = Content{}
   213  var MerkleDagRedux = Content{}
   214  var MerkleDagIpfsObjects = Content{}
   215  var MerkleDagIpfsPaths = Content{}
   216  var MerkleDagImmutability = Content{
   217  	Title: "Immutability",
   218  	Text: `
   219  	TODO plan9
   220  	TODO git
   221  	`,
   222  }
   223  
   224  var MerkleDagUseCaseUnixFS = Content{}
   225  var MerkleDagUseCaseGitObjects = Content{}
   226  var MerkleDagUseCaseOperationalTransforms = Content{}
   227  
   228  var Network_Intro = Content{}
   229  var Network_Ipfs_Peers = Content{}
   230  var Network_Daemon = Content{}
   231  var Network_Routing = Content{}
   232  var Network_Exchange = Content{}
   233  var Network_Naming = Content{}
   234  
   235  var Daemon_Intro = Content{}
   236  var Daemon_Running_Commands = Content{}
   237  var Daemon_Web_UI = Content{}
   238  
   239  var Routing_Intro = Content{}
   240  var Rouing_Interface = Content{}
   241  var Routing_Resolving = Content{}
   242  var Routing_DHT = Content{}
   243  var Routing_Other = Content{}
   244  
   245  var Exchange_Intro = Content{}
   246  var Exchange_Bitswap = Content{}
   247  var Exchange_Strategies = Content{}
   248  var Exchange_Getting_Blocks = Content{}
   249  
   250  var Ipns_Consistency = Content{}
   251  var Ipns_Mutability = Content{}
   252  var Ipns_Name_System = Content{}
   253  var Ipns_PKI_Review = Content{
   254  	Title: "PKI Review",
   255  	Text: `
   256  	TODO sign verify
   257  	`,
   258  }
   259  var Ipns_Publishing = Content{}
   260  var Ipns_Records_Etc = Content{}
   261  var Ipns_Resolving = Content{}
   262  
   263  var Mounting_General = Content{} // TODO note fuse
   264  var Mounting_Ipfs = Content{}    // TODO cd, ls, cat
   265  var Mounting_Ipns = Content{}    // TODO editing
   266  
   267  var Plumbing_Intro = Content{}
   268  var Plumbing_Ipfs_Block = Content{}
   269  var Plumbing_Ipfs_Object = Content{}
   270  var Plumbing_Ipfs_Refs = Content{}
   271  var Plumbing_Ipfs_Ping = Content{}
   272  var Plumbing_Ipfs_Id = Content{}
   273  
   274  var Formats_MerkleDag = Content{}
   275  var Formats_Multihash = Content{}
   276  var Formats_Multiaddr = Content{}
   277  var Formats_Multicodec = Content{}
   278  var Formats_Multikey = Content{}
   279  var Formats_Protocol_Specific = Content{}