X Tutup
Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.07 KB

File metadata and controls

54 lines (36 loc) · 1.07 KB

Snippets

You can store code snippets in Gitlab. Snippets can be attached to projects (see :ref:`project_snippets`), but can also be detached.

Examples

List snippets woned by the current user:

.. literalinclude:: snippets.py
   :start-after: # list
   :end-before: # end list

List the public snippets:

.. literalinclude:: snippets.py
   :start-after: # public list
   :end-before: # end public list

Get a snippet:

.. literalinclude:: snippets.py
   :start-after: # get
   :end-before: # end get

Warning

Blobs are entirely stored in memory unless you use the streaming feature. See :ref:`the artifacts example <streaming_example>`.

Create a snippet:

.. literalinclude:: snippets.py
   :start-after: # create
   :end-before: # end create

Update a snippet:

.. literalinclude:: snippets.py
   :start-after: # update
   :end-before: # end update

Delete a snippet:

.. literalinclude:: snippets.py
   :start-after: # delete
   :end-before: # end delete
X Tutup